Christian Beikov (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZDg2ODY1YzM0...
) / New Feature (
https://hibernate.atlassian.net/browse/HHH-16187?atlOrigin=eyJpIjoiZDg2OD...
) HHH-16187 (
https://hibernate.atlassian.net/browse/HHH-16187?atlOrigin=eyJpIjoiZDg2OD...
) Recursive join fetch (
https://hibernate.atlassian.net/browse/HHH-16187?atlOrigin=eyJpIjoiZDg2OD...
)
Issue Type: New Feature Assignee: Unassigned Components: hibernate-core Created:
15/Feb/2023 07:53 AM Fix Versions: 6.wishlist Priority: Major Reporter: Christian Beikov (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
Transitioning this over from the GH discussion (
https://github.com/hibernate/hibernate-orm/discussions/6100 ) :
We added the recursive CTE construct to model the canonical way to do recursive queries in
HQL, but I think it would be nice to extend this a bit. Here are a few ideas.
The idea is that we introduce a new kind of join, a recursive join, which we translate to
a recursive CTE. Recursive joins would only be allowed on self referencing @ManyToOne /
@OneToMany(mappedBy) associations.
If we want to support EAGER fetching of recursive associations we would probably need some
sort of @RecursiveParent / @RecursiveChildren annotation to mark associations in an entity
model, so that we can generate the proper query, but I guess we can ignore that for now.
The really interesting part is when join fetching collections e.g. from Entity1 a
recursive join fetch a.children , as that has an implication on the Fetch we generate and
how we process results, since all nested collection will become initialized this way.
(
https://hibernate.atlassian.net/browse/HHH-16187#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16187#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100216- sha1:a1e7611 )