I believe we can avoid having to introduce a new listener unlike what Lukasz suggests. Instead, we'd have the EnversPostUpdateEventListener inspect the event's oldState and if the value is null, we'd have the listener use the database snapshot from the entity persister instead. If the oldState on the event isn't null, the listener would use the supplied values as-is. From what I can tell, this solves the detached entity update problem for this use case. |