-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support JOIN/ON for two root entities #128
Comments
@glassfishrobot Commented |
@glassfishrobot Commented But think this won't apply to "FETCH JOIN" which still needs to be along a relation, hence spec needs to distinguish the syntax difference between JOIN and FETCH JOIN. |
@glassfishrobot Commented |
@glassfishrobot Commented |
|
To be clear, we're talking about queries like this: select book.title, publisher.name
from Book book
join Publisher publisher
on book.publisher = publisher
where book.title like :titlePattern Correct? If so, then this is something that both EclipseLink and Hibernate have supported for quite a long time, and it's something that should be quite trivial to add to the spec. I would say we can easily do this for 3.2. |
Please review proposal #467, which also cleans up some of the language in that section of the spec. |
Currently JPA does not allow root entities after various JOIN clauses which means that especially outer joins cannot be specified and executed without association path. In some cases it may be beneficial when we can join even when the relation is not mapped, e.g. to avoid potentially EAGER One- or @manytoone relationship (LAZY is only hint, not guaranteed).
EclispeLink currently supports such joins and they add a lot of options how to solve some problems with a minimal JPQL change. "EclipseLink also supports usage of the ON clause between two root level objects." See: https://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Basic_JPA_Development/Querying/JPQL#ON
Please, consider root entites as candidates for joins.
The text was updated successfully, but these errors were encountered: