Re: Possible optimization when query candidate is a class with no base class


Page bloom
 

I tested the dontRestrictDiscriminator option but unfortunately it applies regardless of whether the class has a table (new-table in the meta data) or just uses the table of a class in its inheritance hierarchy.

So consequently, whenever a query is performed where the candidate class is a subclass and doesn't have it's own table but uses that of a superclass settingĀ 
datanucleus.query.dontRestrictDiscriminator=true
will also prevent the SQL having a discriminator where clause even though they are definitely needed in that case otherwise it picks up every type of class in the table.

I was hoping the option would only apply to "classes with a table" as per my optimistic interpretation :)

Maybe the note could say, "classes with a table or classes extending a class with a table" or maybe clearer to say it's a global option and discriminators will never be used in any query to restrict class types to that of the candidate class or its subclasses - you would basically need to have "table per class" strategy for that to be workable.

Join main@datanucleus.groups.io to automatically receive all group messages.