I have basic inheritance:
Employee extends Person
How can I write EQL to obtain list of persons?
When I write:
SELECT res FROM Person res
the result is list of persons AND employees.
It is right in object design becouse Employee IS Person.
1. to use AbstractPerson instead of Person
Person extends AbstractPerson
Employee extends AbstractPerson
It works but it is not nice ;-).
2. EQL like:
SELECT res FROM Person res LEFT JOIN Employee e ON res.id=e.id WHERE e IS NULL
It does not work - see spec. page 79
3. There exists discriminator column in DB (@DiscriminatorColumn).
Is there a way to obtain value of this column in EQL?
Something like this
"WHERE res.class = Person"
is missing in specification.