Community
Participate
Working Groups
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; InfoPath.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30) Build Identifier: 2.0.0.v20091026-r5655 When utilising a named query that contains one or more JOIN FETCHs it throws a MismatchedTokenException saying the aliases are incorrect syntax. An example of that is: SELECT js FROM JobScenario js JOIN FETCH js.scenarioDefinition sd ORDER BY js.scenario It will fail citing the 'sd' alias is invalid syntax regardless of if you utilise the 'sd' or not in a subsiquent JOIN FETCH, where clause, etc. Reproducible: Always Steps to Reproduce: 1. Attempt any query with a JOIN FETCH alias (sorry I can't submit the code)
Created attachment 150914 [details] Bug stacktrace
This is functionality we would like to support in the future and is supported using the new Criteria API from JPA 2.0. However the JPA specification currently disallows this functionality within the JPQL statement. You would have to change your query to SELECT js FROM JobScenario js JOIN FETCH js.scenarioDefinition join js.scenarioDefinition AS sd ORDER BY js.scenario
Fixed in Hermes
Fixed in 2.4
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink