Hi guys,
With Hibernate I'm used to do 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 query on the stack is different from the one above, but the result is the same)
I've 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 a different entity in my domain model, suspecting that maybe my mapping is not correct. Still, the same problem.
Could it be that I can only achieve this using a query hint? I don't want to do that.
By the way, I'm using EcliseLink as shipped with Netbeans 6.8 and Glassfish v3.
I'd appreciate any help!
Rodrigo