I am using Hibernate Envers to audit my entities and properties (org.hibernate.envers.global_with_modified_flag=true
). This seems to work, but now I'd like to get all properties of a specific entity which changed at a given revision, compared to the previous one. As a bonus, it would be nice to get the changeset from one revision to another one. So far, I only get the modified entities:
List<Object> modifiedClassesAtRevision = getAuditReader().getCrossTypeRevisionChangesReader().findEntities(revision, RevisionType.MOD)
Object modifiedObject = modifiedClassesAtRevision.get(0);
Now, since I do not want to create comparison methods for all entities in Java, is there any way to get the modified properties of this revision? Something along the lines of
List<String> modifiedProperties = getAuditReader().getModifiedProperties(modifiedObject, revision);
would be nice to have - but maybe I am just too stupid to find that kind of feature.
Currently it's only possible to query for entities where a property was modified, see http://docs.jboss.org/hibernate/core/4.1/devguide/en-US/html/ch15.html#envers-envers-tracking-properties-changes-queries.
Getting a descriptor (changeset) of which properties changed is not yet possible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With