I am trying to create an Audit table that will ends looking something like that :
entity,id,property,oldValue,newValue,user,timestamp
An alternative approach is to store the previous state on load.
@Entity @Table(name='Foo') class Foo { @Transient private Foo previousState; @PostLoad private void setPreviousState(){ previousState = new Foo(); //copy the fields } public Foo getPreviousState(){ return previousState; } }