I am writing a "where" expression clause for a toplink query. The descriptors and object structure is such that my original object contains an attribute "entity" that is a reference to another abstract class object. The object "login" extends and fully completes "entity". The restrictions I need to put in my where clause include those limited to "login", and not accessible in "entity".
How can I say in the query that I want to make sure I am selecting an instance of login and not just all instances of entity?
builder.get("entity").get("username") does not work because only the login subclass has username.