Version history for entities: Hibernate Envers
With Hibernate Envers, an entity class
Ent
annotated with an@Audited
annotation will automatically be stored in a tableEnt_aud
. TheEnt_aud
table stores revisions of all properties annotated with@Audited
or all fields from an entity when the whole class is annotated. It also stores arev
value (global counter), which refers to a row in therevinfo
table, holding information such as the timestamp of the revision. We probably can extend its capabilities to store the principal information in therevinfo
table, such that we can present a log for a property or entity with revision history including the user responsible for the changes.Basic example: http://www.javaroots.com/2013/08/how-to-maintain-audit-history-in-db.html
Submitted by Elmer van Chastelet on 21 January 2015 at 10:44
Log in to post comments