I have one Hibernate entity with following structure:
@Entity
public class A
{
private Integer id;
private String name;
@OneToMany
private List<B> bList;
}
@Entity
public class B
{
private Integer id;
@OneToMany
private List<C> cList;
}
Now I wants to maintain history on entity "A", with information like :
historyDate | fieldsChanged | updatedBy | createdBy
In fieldsChanged
column i want the name of the columns of entity A and if any changes applied in entity B or C.
Now I have googled and find few of the following ways to achieve these :
Now I am not sure what should be the better approach from above or anything else.
Any suggestion would be highly appreciated...
Envers uses a different auditing scheme - storing the full content of an entity for each change. The answer really depends on what you need.