Skip to content

Conversation

@gavinking
Copy link
Member

New API operations should generally be marked @Incubating, especially when they occur on prominent interfaces like Session, Query, or SessionFactory. These ones weren't. (Sometimes we forget.)

And there was a reason they should have been: their signatures are not type safe, featuring an unbound type parameter in the return type, even though their type argument is reified internally. So a RootGraph<Book> can masquerade as a RootGraph<Author>. This is a big antipattern that I've been trying to systematically root out throughout the whole codebase.

[Please describe here what your change is about]


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.


New API operations should generally be marked @Incubating,
especially when they occur on prominent interfaces like
Session, Query, or SessionFactory. These ones weren't.
(Sometimes we forget.) And there was a reason they should
have been: their signatures are not type safe, featuring
an unbound type parameter in the return type, even though
their type argument is reified internally. So a
RootGraph<Book> can masquerade as a RootGraph<Author>.
This is a big antipattern that I've been trying to
systematically root out throughout the whole codebase.
@gavinking gavinking marked this pull request as ready for review December 9, 2025 09:46
@hibernate-github-bot
Copy link

Thanks for your pull request!

This pull request does not follow the contribution rules. Could you have a look?

❌ All commit messages should start with a JIRA issue key matching pattern HHH-\d+
    ↳ Offending commits: [cb4005f]

› This message was automatically generated.

@gavinking gavinking merged commit 2f2fd3d into hibernate:7.1 Dec 9, 2025
26 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant