Questions tagged [hibernate-envers]

Hibernate Envers is a core module of the Hibernate framework that enables simple entity auditing and change tracking using annotations and simple configuration steps.

Hibernate Envers is a core module of Hibernate.

Envers provides simple entity auditing and change tracking by using Java annotations to influence what it to be tracked by the change management listeners. The module allows you to save historical changes (CRUD operations) made on your persistent entities in audit specific tables that are created by Envers automatically.

Official site:
http://www.hibernate.org/orm/envers

To take advantage of Hibernate Envers, you first need to add the dependency. You simply need to configure the dependency as follows:

<dependency>
  <groupId>org.hibernate</groupId>
  <artifactId>hibernate-envers</artifactId>
  <version>5.2.8.Final</version>
</dependency>

It's important to remember that the version of Envers you should use must match the same version of Hibernate that your application is using.

A Simple Example

@Entity
@Audited
public class Person {
  @Id
  private Integer id;
  private String name;
  private Date dateOfBirth;
  // getter/setters
}

Guides And Tutorials:

883 questions
0
votes
2 answers

What is the primary key of an audit table managed by Hibernate Envers?

I am using Hibernate Envers to audit some entities. I manually created the associated audit tables. However, I am having trouble determining what an audit table's primary key should be. For example, consider a fictional table designed to store…
Adam Paynter
  • 46,244
  • 33
  • 149
  • 164
0
votes
3 answers

difficulties getting a simple envers example to work: problem #34

I'm trying to get a simple envers example to work. I have the Java code working (apparently), and I finally got the org.hibernate.tool.ant.EnversHibernateToolTask to work, but it only outputs SQL for the "regular" data, not the versioning data. I'm…
Jason S
  • 184,598
  • 164
  • 608
  • 970
0
votes
1 answer

Possibility of using approve/reject concept for changed entities?

I'm exploring envers at the moment and working through the documentation. There is one of my requirement which envers doesn't fulfil (as I think right now). Maybe it does and someone can point me to something or has another solution for this. The…
Kai
  • 38,985
  • 14
  • 88
  • 103
0
votes
2 answers

Issues building Hibernate 4.1.2.final through gradle

I am trying to patch hibernate due to HHH-6960. However, the following issue arrises when executing gradle clean build. FAILURE: Build failed with an exception. * Where: Build file…
mosgjig
  • 537
  • 1
  • 9
  • 18
0
votes
4 answers

what the heck is a JPA configuration?

I'm going nuts trying to get a simple Envers example to work. I'm stuck on the org.hibernate.tool.ant.EnversHibernateToolTask — it looks like I finally got all the jar files I needed, but now I get the error message [hibernatetool] Persistence unit…
Jason S
  • 184,598
  • 164
  • 608
  • 970
0
votes
3 answers

Hibernate Envers: Retrieving the right revisions of an entity with a collection property

I have two audited entities, A and B. Entity A holds a collection of entity B (annotated as One-to-many relationship). When inserting a new instance of A into the database, all rows of A and B are at the same revision (let's say revision 1). Then,…
Jim Holden
  • 1,196
  • 1
  • 16
  • 37
-1
votes
1 answer

Does Envers function not work if I use JPQL?

I'm using Hibernate Envers, but if I use JQPL grammar, can't I detect deletion?
ccc
  • 15
  • 3
-1
votes
1 answer

Provider org.hibernate.envers.boot.internal.EnversIntegrator not a subtype tomcat 8

so i am using the jar hibernate-envers 5.1.14 and hibernate-core 5.4.14 with tomcat 8 and i am facing this exception : Caused by: java.util.ServiceConfigurationError: org.hibernate.integrator.spi.Integrator: Provider…
aabc
  • 9
  • 5
-1
votes
1 answer

Should Hibernate Envers library be used to business logic?

Simple case: There is a user who wants to know when he changed his username. Should I use auditing data to do that? Are auditing data for admins only?
Marek Raki
  • 3,056
  • 3
  • 27
  • 50
-1
votes
1 answer

Update history table with Old and New values using Spring Boot, JPA

Technologies used: Spring Boot, Spring Data JPA. Problem Summary: I have a use case to update order_tracking table when ever any status change happen in the purchase_order table's User Entity: @Entity @Access(AccessType.FIELD) @Table(name =…
-1
votes
1 answer

Unable to change revinfo table name in Hibernate Envers

I went to the documentation (http://docs.jboss.org/envers/docs/#revisionlog) there it was written that if we annonate an entity with @RevisionEntity then Hibernate will not create default revinfo table by its own instead it will map the entity which…
aeroboy
  • 149
  • 4
  • 14
-1
votes
2 answers

At an Crud (update...) events record the change in values (who,when, old value, new value...)

I want a system identical to Audit Logging Plugin (http://grails.org/plugin/audit-logging) but for Java. Hibernate envers allows to store all the data for each release. It does not know what data is changed. I would only store the changed values.…
-2
votes
1 answer

How to get list string of column is changed in Hibernate Envers withModifiedFlag = true

I use Hibernate Envers with "withModifiedFlag = true" for table "user", the columns _mod is generated with boolean data. But I can not get list of changed columns by code, or the way to get them.
Toi Nguyen
  • 413
  • 1
  • 6
  • 17
1 2 3
58
59