Hibernate Envers is a core module of the Hibernate framework that enables simple entity auditing and change tracking using annotations and simple configuration steps.
Hibernate Envers is a core module of Hibernate.
Envers provides simple entity auditing and change tracking by using Java annotations to influence what it to be tracked by the change management listeners. The module allows you to save historical changes (CRUD operations) made on your persistent entities in audit specific tables that are created by Envers automatically.
Official site:
http://www.hibernate.org/orm/envers
To take advantage of Hibernate Envers, you first need to add the dependency. You simply need to configure the dependency as follows:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-envers</artifactId>
<version>5.2.8.Final</version>
</dependency>
It's important to remember that the version of Envers you should use must match the same version of Hibernate that your application is using.
A Simple Example
@Entity
@Audited
public class Person {
@Id
private Integer id;
private String name;
private Date dateOfBirth;
// getter/setters
}
Guides And Tutorials:
Quick Start from official documentation.