I understand Envers generates a table to store the audit trail. Is it possible to manually assign a table where I want the data to be stored. Instead of allowing Envers to generate a table by itself?
Additionaly, there is a "REVINFO" table generated, which contains only two fields: the revision id and revision timestamp. A row is inserted into this table on each new revision, that is, on each commit of a transaction, which changes audited data.
Enable JpaAudit In order to enable JPA Auditing for this project will need to apply three annotations and a configuration class. Those annotations are; @EntityListener , @CreatedDate , and @LastModifiedDate . @EntityListener will be the one that is responsible to listen to any create or update activity.
It will only generate the tables if you are using one of the ddl auto options.
If you want to control the naming of the audit tables during this process or, create the tables yourself and have them named differently then you specify the value for the @AuditTable annotation and/or specify the prefix and suffix in the configuration.
Additionally, you can control/specify the name of the global REVINFO table using the @RevisionEntity annotation.
http://docs.jboss.org/envers/docs/#tables
All of which is detailed in the comprehensive documentation:
http://docs.jboss.org/envers/docs/#tables
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With