Add other columns to the audit table using Hibernate Envers

Can I add other columns to the audit table?
For example, I have a table like this

@Entity
@Table(name="EmpEnverPrac")
@Audited
public class EmpEnverPractice {


@Id
@Column(name="ID")
@GeneratedValue(strategy = GenerationType.AUTO)
private Integer id;

@Column(name="NAME")
private String name;

@Column(name="password")
@NotAudited
private String password;

// getter and setters

}

Now I want to use the audit table I generated I added some extra columns, but I don’t want to include them in my entity. I can’t find any solution that meets this requirement. Please tell me the required configuration. Thanks in advance

I found a solution because I can add additional columns (the default names given by hibernate) in the REVINFO table. This table is Each transaction in the application stores an id with a timestamp so that I can get information about any transaction. There is reference here http://docs.jboss.org/envers/docs/#revisionlog

Is it possible to add other columns in the audit table?
For example, I have a table like this

@Entity
@Table(name="EmpEnverPrac")
@Audited
public class EmpEnverPractice {


@Id
@Column(name="ID")
@GeneratedValue(strategy = GenerationType.AUTO)
private Integer id;

@Column(name="NAME")
private String name;

@Column(name="password")
@NotAudited
private String password;

// getter and setters

}

Now I want to use the audit table I generated I added some extra columns in my entity, but I don’t want to include them in my entity. I can’t find any solution that meets this requirement. Please tell me the configuration required. Thanks in advance

I found a solution because I can add an extra column (the default name given by hibernate) to the REVINFO table. This table stores a timestamp for each transaction in the application Id so that I can get information about any transaction. Here are references http://docs.jboss.org/envers/docs/#revisionlog

Leave a Comment

Your email address will not be published.