Hi,
I followed many docs about how integrating HIBERNATE ENVERS for auditing models but it seems that v2.x.x is not compatible with this !!!
Does someone has an idea please ? this is what i follow :
1- application.conf
hibernate.ejb.event.post-insert="org.hibernate.ejb.event.EJB3PostInsertEventListener,org.hibernate.envers.event.AuditEventListener"
hibernate.ejb.event.post-update="org.hibernate.ejb.event.EJB3PostUpdateEventListener,org.hibernate.envers.event.AuditEventListener"
hibernate.ejb.event.post-delete="org.hibernate.ejb.event.EJB3PostDeleteEventListener,org.hibernate.envers.event.AuditEventListener"
hibernate.ejb.event.pre-collection-update="org.hibernate.envers.event.AuditEventListener"
hibernate.ejb.event.pre-collection-remove="org.hibernate.envers.event.AuditEventListener"
hibernate.ejb.event.post-collection-recreate="org.hibernate.envers.event.AuditEventListener"
2- Sample Model by adding annotation @Audited
package models;
import java.util.*;
import javax.persistence.*;
import javax.persistence.Column;
import com.avaje.ebean.Model;
import play.data.format.*;
import play.data.validation.*;
import com.avaje.ebean.*;
import com.avaje.ebean.Query;
import play.db.ebean.*;
import java.util.Date;
import java.text.SimpleDateFormat;
import org.hibernate.envers.Audited;
@Entity
@Audited
public class Task extends Model implements Cloneable {
@SuppressWarnings("unused")
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
public Long id;
public String description;
@Formats.NonEmpty
public Boolean active = false;
@Formats.DateTime(pattern="yyyy-MM-dd HH:mm:ss")
public Date startdate;
public Boolean monday = false;
public Boolean tuesday = false;
public Boolean wednesday = false;
public Boolean thursday = false;
public Boolean friday = false;
public static Find<Long,Task> find = new Find<Long,Task>(){};
}
3- No Table was created sufixed by _AUD => in this case a table should be created such as :