Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
Asanio06 wants to merge1 commit intohibernate:main
base:main
Choose a base branch
Loading
fromAsanio06:HHH-19610

Conversation

Asanio06
Copy link
Contributor

@Asanio06Asanio06 commentedJul 12, 2025
edited
Loading

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

@sebersole
Copy link
Member

sebersole commentedJul 14, 2025
edited
Loading

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:

GraphParsingTestSubEntity:sub, name, description

Bacause otherwise, something like this just looks odd -

(GraphParsingTestSubEntity:sub(subName, subOtherStuff)), name, description

whereas this is a little bit better:

GraphParsingTestSubEntity:sub(subName, subOtherStuff), name, description

@sebersole
Copy link
Member

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@Asanio06@sebersole

[8]ページ先頭

©2009-2025 Movatter.jp