Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Envers use a different database?

Is possible for Hibernate Envers to use another database for audit tables?

like image 704
romifz Avatar asked Nov 15 '12 12:11

romifz


People also ask

How does Hibernate Envers work?

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.

What is Revtype in Envers?

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 ).

What are Envers?

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.

What is Revinfo table?

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.


1 Answers

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

like image 162
adamw Avatar answered Sep 28 '22 03:09

adamw