brightspot-cms
brightspot-cms copied to clipboard
Query only parent class instances
Hi,
I found I get instances of Parent class and also instances of all subclasses when I call:
Query.from(Parent.class).selectAll();
What is best approach to query only Parent class instances? I found
Query.from(Parent.class).where("_type = ?", ObjectType.getInstance(Parent.class).getId()).selectAll();
But I am not sure if it is best way to do it.
Thanks for response, O.