Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add additional column in audit table with hibernate envers

Is it possible to add additional column in 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 some additional column in my generated audit table but i don't want to include them in my entity. I am not able to find any solution for this requirement. kindly tell me the required configuration. thanks in advance

like image 963
rishi Avatar asked Oct 20 '22 03:10

rishi


1 Answers

I found a workaround for my requirement because i can add additional column in REVINFO table(default name given by hibernate). This table stores id with timestamp for every transaction in application so i can get the information about any transaction. Reference is available here http://docs.jboss.org/envers/docs/#revisionlog

like image 74
rishi Avatar answered Oct 23 '22 23:10

rishi