问题
I want to add in my project a list of the revision changes (on click in info icon) like:
Revision X
- added fieldA entry
- modified fieladB from B to BB
- removed fieldC entry
...
Which is the best way?
ps: I already use EntityTrackingRevisionListener.
Thanks.
回答1:
The best way currently is to load the history of an object (list of historical versions) and compare in Java.
The latest release (4.1) also has support for adding modified flags (boolean, specify if a field was modified or not in that revision): http://docs.jboss.org/hibernate/core/4.1/devguide/en-US/html/ch15.html#envers-tracking-properties-changes
Maybe this could be extended to an ADD/MOD/DEL enum, just as with entities.
来源:https://stackoverflow.com/questions/9422331/hibernate-envers-revision-info-changes-list