With Hibernate, I'm used to doing something like the following:
select n from NetworkElement n join fetch n.site s where s.active is true
However, EclipseLink complains a lot about this:
Caused by: Exception [EclipseLink-8024] (Eclipse Persistence Services - 2.0.0.v20091127-r5931): org.eclipse.persistence.exceptions.JPQLException
Exception Description: Syntax error parsing the query [select n from NetworkElement n join fetch n.site s], line 1, column 49: syntax error at [s].
(The request on the stack is different from the previous one, but the result is the same)
I tried different combinations, none of which worked:
select n from NetworkElement n join fetch n.site where n.site.active is true
select n from NetworkElement n join fetch n.site as site where site.active is true
I also tried switching to another entity in my domain model, suspecting that perhaps my mapping was incorrect. However, the same problem.
Maybe I can achieve this only with a hint? I do not want to do this.
By the way, I use EcliseLink as supplied with Netbeans 6.8 and Glassfish v3.
I would be grateful for any help!
Rodrigo
source
share