Is possible for Hibernate Envers to use another database for audit tables?
Hibernate Envers provides a very simple solution for CDC (Change Data Capture). It uses the Hibernate Event system to intercept all entity state transitions and audit them. The database transaction will roll back and both the actual changes and the audit log is rolled back.
org.hibernate.envers.revision_type_field_name (default: REVTYPE ) Name of a field in the audit entity that will hold the type of the revision (currently, this can be: add , mod , del ).
The Envers module is a core Hibernate model that works both with Hibernate and JPA. In fact, you can use Envers anywhere Hibernate works whether that is standalone, inside WildFly or JBoss AS, Spring, Grails, etc. The Envers module aims to provide an easy auditing / versioning solution for entity classes.
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.
You can use a different schema/catalog. See the org.hibernate.envers.default_schema
and org.hibernate.envers.default_catalog
configuration properties [1], as well as the schema
/catalog
attributed of @AuditTable
.
[1] http://docs.jboss.org/hibernate/core/4.0/devguide/en-US/html/ch15.html
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