Community
Participate
Working Groups
The following query will not result in an exception but will not join fetch any of the requested fields. "select e from Employee e join e.managedEmployees m join fetch e.managedEmployees where m.address.city = 'Ottawa' " This failure would be very difficult for a user to detect.
Setting target and priority. See the following page for a description of the meanings of these values: http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines
I believe the issue is a comma is missing, all joins must use a comma, otherwise there are assumed to be nested joins, The JPQL should be, select e from Employee e join e.managedEmployees m, join fetch e.managedEmployees where m.address.city = 'Ottawa' Without the comma it is a nested join like, select e from Employee e join fetch e.managedEmployees, join e.managedEmployees m join fetch m.address where m.address.city = 'Ottawa' Otherwise you are join fetching the m, managedEmployees, not the e. Not sure why this is not triggering an error though, we probably end up adding the e.managedEmployees expression to the joined attributes of m. We should be raising an error when ever the wrong alias is used in a join, my guess this is not just join fetches, but any joins, i.e. select e from Employee e join e.managedEmployees m join e.managedEmployees where m.address.city = 'Ottawa' or, Select e from Employee e join m.address, Employee m where e.manager = m You should get an error like "Wrong alias used in join"
In the BNF the ',' us used to separate identification_variable_declarations not joins. Each identification_variable_declaration may include any number of joins some of which would be nested and some that would not be but there is no ',' within the 'join' syntax. A non nested join would be written as. FROM Employee e JOIN e.address a JOIN e.manager , Project p JOIN p.teamLeader t
This works with Hermes, seems to be a bug in our ANTLR parser.
Fixed in 2.4
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink