문제

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top