Skip to content
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

Introduce PreMerge lifecycle callback #635

Open
beikov opened this issue Jun 4, 2024 · 2 comments
Open

Introduce PreMerge lifecycle callback #635

beikov opened this issue Jun 4, 2024 · 2 comments
Labels
candidate-for-4 Good candidate for JPA 4

Comments

@beikov
Copy link

beikov commented Jun 4, 2024

The idea is to introduce a new lifecycle callback that allows to react to merge being called for an entity. This is different from PreUpdate in the sense that this operation would be called on a detached entity instance instead of on the managed entity instance.

If an entity stores some transient state that should be synchronized with persistent state, it is desirable to do so before the merge operation copies the state from the detached object to a managed object. Also see https://discourse.hibernate.org/t/queryparameterbindingvalidator-uses-property-type-instead-of-attributeconverter-type/9650/2

@gavinking
Copy link
Contributor

This is a good idea.

@gavinking
Copy link
Contributor

This could be done along with #167.

@gavinking gavinking added the candidate-for-4 Good candidate for JPA 4 label Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
candidate-for-4 Good candidate for JPA 4
Projects
None yet
Development

No branches or pull requests

2 participants