1 package de.spring.example.persistence.domain.audit;
3 import javax.persistence.Column;
4 import javax.persistence.Entity;
5 import javax.persistence.Table;
7 import org.hibernate.envers.DefaultRevisionEntity;
8 import org.hibernate.envers.RevisionEntity;
11 @RevisionEntity(MyCustomRevisionListener.class)
12 @Table(name="CUSTOM_REVISION", schema="mybatis_example")
13 public class MyCustomRevision extends DefaultRevisionEntity {
14 @Column(name="USERNAME")
15 private String username;
17 // It will be used by JPA when filling the property fields with data coming from data base.
18 protected MyCustomRevision() {
22 // It will be used by my code (for example by Unit Tests)
23 public MyCustomRevision(String username) {
24 this.username = username;
28 * WARNING: JPA REQUIRES GETTERS!!!
31 public String getUsername() {
35 public void setUsername(String username) {
36 this.username = username;