| Summary: | ReadAllQuery doesn't use the table alias in select | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | uygar yuzsuren <uygaryuzsuren> |
| Component: | Eclipselink | Assignee: | James Sutherland <jamesssss> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | blocker | ||
| Priority: | P2 | CC: | eclipse_bugs, jamesssss, tom.ware |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | |||
|
Description
uygar yuzsuren
If you have a mapping for a relationship between Gameincrements and Livegame, you should be able to work around this issue by changing your query to something like the following: select g from Gameincrements g join g.livegame l where l.id=:liveGameId Please update the bug with a code/xml that shows the key mappings in Gameincrements and Livegame. Okay, it is very nice to have a workaround. But in this case one will have to modify all of his queries:( Anyways, if it is the right way of doing this in EJB QL, and it is going to work for any persistence implementation other than EclipseLink, then no problem. You know, one of the advantages of using specifications is their implementation-independence, isn't it? But, if the specification allows such a usage (without explicit join), then I suggest that it should be implemented. Thank you very much. The suggestion above is the way you are expected to write this query in JPA. Writing your query this way allows a more efficient build of the query itself. Additionally, it is more flexible since if you change your mappings, you will not have to change your queries to reflect new join criteria. Having said that, you are right, although it is not the recommended way to write this kind of query, the JPQL you have written is allowed by the spec and we should fix this issue. If you are on one of our 1.x builds, you might want to try a nightly build from our 2.0 stream as there have been some fixes in that area in 2.0. Setting target and priority. Details of what this means can be found here. http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines Another workaround that may solve the issue is to alter the order of the items in the FROM clause: 'select g from Livegame l, Gameincrements g where l.id=g.livegame.id and l.id=:liveGameId' *** Bug 289677 has been marked as a duplicate of this bug. *** It is surprising to me that an SQL syntax error '(t0.ID = )' ((from the dup'd Bug 289677)) is the same as this issue, but I'm sometimes easily surprised. Cannot recreate in main, 2.0 (10/27/2009) I assume also fixed in 1.2. The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |