About EntityPersister We use a custom entity persister for entities that we annotated with @DynamicUpdate The reason is as follow:
- DynamicUpdate will only generate sql statement with the properties that were changed
- Our entities have important properties: updateUser, updateDateTime which need to be updated as well
We tried to add a hibernate listener to update these 2 properties on every flush, but the update sql was only being generated for the properties that were changed… not the properties changed by the hibernate listener. So, we decided to create a customer persister and override the findDirty method in order to also return the indexes for udpateUser and updateDateTime In summary, with the deprecation of @Persister, we’ll need a way to customize findDirty or that hibernate computes the dirty properties after custom flush listeners. I’m happy to provide more info or discuss this further. |