-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
HHH-18829 Auto generate record ID class if no explicit @IdClass #9220
base: main
Are you sure you want to change the base?
Conversation
Last two commits are idea for potential solution on Hibernate Core side. |
pw.println( ") {}" ); | ||
pw.println(); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is nice and simple, for sure, but it's kind-of a layer-breaker. It would be better to make a new subclass of AnnotationMeta
for this, even though I admit that's a PITA.
[I don't love the architecture, but it's not terrible, and it's what we've inherited.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, but I think that generated ID class should be member of generated entity (or embeddable?) meta class. Then it should be implementing MetaAttribute
which is less than half PITA :-)
Additional thing is that order of record components should be preserved. At least one test in core failed due to that.
…or when class is not annotated with @IdClass, but have more than one member annotated with @id
…ID class can not be resolved
…rties in entity class
…into preserve order of record components in generated ID class
…ber of parent AnnotationMetaEntity
Jira Issue HHH-18829
This is "sketch" of the problem solution on the side of Hibernate Processor.
TODO : Change Hibernate Core to use generated ID class.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.