Introduce PreMerge lifecycle callback
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
This is a good idea.
This could be done along with #167.