Ok, I found a solution. I do not think this is the best due to multiple joins in the final native query. But it works.
SELECT e FROM Employee e, FullTimeEmployee f, PartTimeEmployee p WHERE (e = f AND f.salary > 1000) OR (e = p ...);
EDIT:
Found another solution that is LOT faster than higher, with 200k lines. Using nested selections in the where clause:
SELECT e FROM Employee e WHERE e.employeeId IN (SELECT f.employeeId FROM FullTimeEmployee f WHERE f.salary > 1000) OR e.employeeId IN (SELECT p.employeeId FROM PartTimeEmployee p WHERE ...)
EDITΒ²:
It seems I no longer need to join the latest version of Hibernate (currently 4.3.10.Final).
SELECT e FROM Employee e WHERE e.salary IS NULL OR e.salary > 1000
must work
source share