What is the order of properties when calling getDirtyProperties from PostUpdateEvent



I’m going to use PostUpdateEventListener. When I’m getting org.hibernate.event.spi.PostUpdateEvent I’d like to know what fields was changed. I have this information from getDirtyProperties(), which are corresponding to getState() array. I need also entity property/field name. How can I find this for giver dirty properties indexes? Or even simpler, what is order of getState() array?



To get the property names use this:

String[] properties = event.getPersister().getPropertyNames();

Then match the array indexes and you’ll know what property has changed.