Use TREAT
to cast an object as its subclass value (that is, downcast related entities with inheritance).
Example 3-14 shows how to use this JPQL extension.
SELECT e FROM Employee JOIN TREAT(e.projects AS LargeProject) p WHERE p.budget > 1000000
For more information, see: