- Notifications
You must be signed in to change notification settings - Fork3.7k
HHH-19610 make GraphParser support subTypeSubGraph#10521
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
sebersole commentedJul 14, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Hi@Asanio06, thanks for the PR! Overall it's a good feature to add :) I'm not a fan of using parenthesis here though - those are already used for sub-graphs so it introduces a bit of syntatic ambiguity. Sure, the use of the colon disambiguites it, but it also does so on its own:
Bacause otherwise, something like this just looks odd -
whereas this is a little bit better:
|
See also discussion at#hibernate-orm-dev > HHH-19610 Make GraphParser support subTypeSubGraph |
Uh oh!
There was an error while loading.Please reload this page.
Today, Jpa's NamedEntityGraph annotation supports the use of subclassSubgraphs to define graphs linked to the subtypes of an Entity. It is also possible, via the entityManager, to do the same thing via the addTreatedSubgraph function.
The goal of this ticket is to improve GraphParser so that it supports a syntax that does the same thing. In this way, Hibernate's own NamedEntityGraph annotation will have 100% of the same functionality as Jpa’s.
I suggest the following syntax for defining a subclassSubgraphs:
(GraphParsingTestSubEntity:sub), name, description
Here we have a sub-graph specific to the GraphParsingTestSubEntity type, which is a sub-type of GraphParsingTestEntity.
The ticket related to my proposal:https://hibernate.atlassian.net/browse/HHH-19610
By submitting this pull request, I confirm that my contribution is made under the terms of theApache 2.0 license
and can be relicensed under the terms of theLGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please checkhere.
https://hibernate.atlassian.net/browse/HHH-19610