-
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
Changes for Hibernate Reactive #9264
base: main
Are you sure you want to change the base?
Conversation
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.
@DavideD Could you please add comments to every new method and constructor explaining that it's used by Reactive.
0bcd408
to
dd782ca
Compare
Comments added |
Thanks man |
Hibernate Reactive extends this class and needs to access/overrides some of the methods.
Hibernate Reactive needs to replace or extends the original id generators. This changes make it possible to pass a function to the EntityMetamodel that allows Hibernate Reactive to replace the original id generators
dd782ca
to
f0b8dca
Compare
Rebased to the latest changes and added a minor refactoring: f0b8dca |
With this change I can remove a lot of duplicate code in Hibernate Reactive.
refactoring Allow me to remove some duplicated code in Hibernate Reactive
f0b8dca
to
25790c2
Compare
Added another small refactoring: 25790c2 |
/** | ||
* A factory for the creation of an EntityMetamodel. | ||
* <p> | ||
* Hibernate Reactive uses it to pass its own entity metamodel class | ||
* and adapt the identifier generators. | ||
*/ | ||
public static class EntityMetamodelFactory { | ||
public EntityMetamodel createEntityMetamodel( | ||
PersistentClass persistentClass, | ||
EntityPersister persister, | ||
RuntimeModelCreationContext creationContext) { | ||
return new EntityMetamodel( persistentClass, persister, creationContext ); | ||
} | ||
} |
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.
@DavideD instead of introducing this new class, could you just add a new createEntityMetamodel()
operation to RuntimeModelCreationContext
?
Or, if that doesn't work, could you at least make it a @FunctionInterface
?
Fix HHH-18854 (I think)
These changes make it possible for me to use Hibernate Reactive with ORM 7 and Postgres.
I still need to fix some issues with the other databases, but I don't think I will have more changes to include for now.
Basically, I needed some way to intercept the creation of the id generator.