|
Re: JPA query with hierarchy [message #666670 is a reply to message #666422] |
Thu, 21 April 2011 10:01  |
Eclipse User |
|
|
|
EclipseLink has a TREAT keyword that allows casting to a subclass, but it is more for accessing a relationship, not the root class,
i.e.
Select e from Employee e join TREAT(e.projects AS LargeProject) lp where lp.budget = value
I think you would need to execute multiple queries in JPQL, one for each subclass you want to query something on.
Otherwise you can use a native SQL query.
I think the issue is similar to,
https://bugs.eclipse.org/bugs/show_bug.cgi?id=312146
So you may wish to add your requirements to that bug and vote for it.
|
|
|
Powered by
FUDForum. Page generated in 0.06429 seconds