Hibernate Envers revision info (changes list)

天大地大妈咪最大 提交于 2019-12-24 00:45:19

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!