Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I change and how to change REVTYPE values in Hibernate Envers?

I'm new in Hiberante and Envers. I successfully implemented Hibernate Envers in my application and made audited tables and everything works fine but I'm wondering is it possible to change values in REVTYPE column in audited tables.

For now I have values 0 (ADD), 1 (MOD) and 2 (DEL). I want to know is it possible to change this values, I want to change for 0 to be for example INSERT, 1 UPDATE and 2 DELETE.

Is this possible and how?

Thank you!

like image 973
snoopy_15 Avatar asked Dec 08 '14 12:12

snoopy_15


People also ask

How Hibernate Envers works?

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 Hibernate 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?

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

This is not possible right now, except for forking the project and changing the code.

like image 178
adamw Avatar answered Oct 12 '22 11:10

adamw