persistence icon indicating copy to clipboard operation
persistence copied to clipboard

Introduce PreMerge lifecycle callback

Open beikov opened this issue 1 year ago • 2 comments

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

beikov avatar Jun 04 '24 09:06 beikov

This is a good idea.

gavinking avatar Jun 04 '24 09:06 gavinking

This could be done along with #167.

gavinking avatar Sep 20 '24 06:09 gavinking