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.

Filter by
Sorted by
Tagged with
0
votes
0answers
12 views

Why is Envers deleting new record after reading REVINFO

My current project is using Hibernate Envers for auditing tables. I have an entity declared as follows: @Entity @Table(name = "CONFIG") @Audited() @Data @JsonIgnoreProperties({ "...
0
votes
1answer
15 views

How to target specific Envers revision in entity relationship to @Audited entity?

I need to maintain entity A relationship to certain revision of @Audited entity B, so that the relationship doesn't always point to the latest version (which is the default behaviour). Is there a ...
2
votes
2answers
46 views

Invocation of init method failed; nested exception is java.lang.NoSuchMethodError after adding Hibernate envers

I'm trying to add hibernate-envers to one of our Spring MVC project. My entity classes are in separate maven module and I'm using envers there and then install this as local maven repo and use in my ...
0
votes
1answer
29 views

Hibernate envers get deleted row data

In my application, I need to show what rows were deleted. I need to find deleted row details of a particular class. So far I got a query that returns deleted entity id, how do I get all entity fields?...
0
votes
1answer
38 views

Hibernate Envers targetAuditMode = RelationTargetAuditMode.NOT_AUDITED not working

I have the following class: @Audited(targetAuditMode = RelationTargetAuditMode.NOT_AUDITED) public class Yard extends ModelObject { // Relations @ManyToOne(optional=false) @JoinColumn(...
0
votes
1answer
20 views

Hibernate Envers replace current data entry with previous audit table entry

I've been using hibernate envers to for auditing purpose in my spring-boot app but there's a requirement where I need to give an option to revert to the previous record from the audit table. In the ...
0
votes
0answers
30 views

Is there any way to avoid audit recording of @Scheduled function actions in database?

We're implementing Envers in a project that has some scheduled tasks which manipulates database records. We don't want these actions to be recorded in audit tables, only the ones users do. Is there ...
1
vote
1answer
19 views

How to make hibernate enhancement plugin ignore some classes?

I use hibernate-enhancement-plugin in my project to implement lazy loading of some entities. But also I have a class AuditEntity that inherits from class DefaultTrackingModifiedEntitiesRevisionEntity ...
0
votes
1answer
28 views

Hibernate-Envers Audit Query: Select latest entity revision where field was equal to value across all entities

I am trying to select the most recent revision of each of my trackedResource entities where a position_source_feed_id has particular value. I have a functional PostgreSQL query: select tr0.* from ...
0
votes
1answer
22 views

How to run one-off script to manipulate jpa entities data and keep trace on envers?

I want to run a one-off script on spring to modify jpa entities and I would like those changes to appear on envers audit tables. I have a spring-boot application using envers to keep track of changes ...
4
votes
0answers
59 views

How to implement @Auditable with dropwizard

I want to implement @Auditable with Dropwizard. Which will create the *_audit table and also store the details with Revinfo table? I am using Dropwizard with Liquibase. I have added @Auditable on ...
0
votes
1answer
43 views

Envers queries use wrong column names for _MOD columns

I am using Hibernate Envers with the @Audited( withModifiedFlag=true ) and I have a problem where the SQL generated for queries has different column names than the one generated by the HBM2DDL tool ...
0
votes
1answer
44 views

Auditing Embeddable Entity using Hibernate Envers

I am trying to add auditing support using Hibernate Envers to the table where entity relations are stored. I am using Spring Boot 2.1.5 and Hibernate 5.3.10. Below are my classes: AuditEntity ...
0
votes
0answers
50 views

How to disable envers auditing for spring boot

i am creating a maven multimoduled project one of the module for the hibernate entity only , issue is two services/api/maven_project are using same module , but one requires auditing but other dont , ...
0
votes
0answers
31 views

Hibernate envers with self entity

I have an requirement where we an entity with self entity and want to audit them. Have a look at it below: @Entity @Table(name = TableNames.CLIENT) @EqualsAndHashCode(exclude="clientContacts") @...
0
votes
0answers
11 views

synchronize all rev from custom_revinfo

Hi i am working on multimoduled (maven) + microsevice based application uses Hibernate envers ,in one of the service i have created uses "custom_revinfo" table, in another service its working with ...
0
votes
0answers
18 views

How to add specific columns for only in *.AUD table not Entity?

I have one table and AUD table of this table. But Aud table has two extra columns like "Inserted_Date" and "Insert_By". Main table haven't this two columns. "Inserted_Date" column include insert time ...
0
votes
1answer
365 views

Are there any ways to create persistent entity example given its class or type?

I am using Hibernate Envers to audit entity changes and we have a lot of audited Hibernate entities in our project. So I want to write a test which for every entity did the following: 1) creates ...
0
votes
1answer
84 views

Setting custom revision information with Hibernate Envers on OpenLiberty

We're migrating an application from JEE7 to JEE8. This application relies on Hibernate-ORM and Hibernate-Envers. On JEE7 it was version 5.2.17, on JEE8 it is 5.4.3 now for both liberaries. We have a ...
0
votes
1answer
17 views

Revision contains null values of other fields if change the @oneToMany - entity by adding a new entity

When a new address is added for a person, a new revision should be created. A revision is created, but the remaining fields of the entity in the revision are marked null. Different and correct: When ...
1
vote
1answer
200 views

Hibernate Envers audit oneToMany side too, even if it has no changes

Have two entities Instrument and Definition. When instrumentCode changed Envers create audited record only for Instrument. I want that when instrumentCode changed Envers create audited records for ...
0
votes
1answer
18 views

Filling columns of modified flags for old revisions in Hibernate Envers

I'm adding modified flags to an already existing audit table. The flags for new revisions added to the table are filled correctly but I want the flags for already existing revisions to be filled. I ...
0
votes
0answers
13 views

How to just audit if a Set of Entities change i.e. adding further entities to this Set (NOT the entity itself)

Person is an auditable Entity and is already annotated with @Audited. One of the property is a Set of Address and this Set is annotated with @OneToMany. The Address itself is a not auditable entity. ...
1
vote
2answers
66 views

How to create Audit Tables automaticcaly without using spring.jpa.hibernate.ddl-auto using Spring Hibernate

I need to create Audit tables automatically when I saved to a table. I added "org.hibernate:hibernate-envers:5.4.2". Final to my gradle file and annotated the Entity using @Audited. I cannot use "...
0
votes
1answer
31 views

Hibernate Envers custom field for user input

I'm using Spring Boot and Hibernate Envers with a custom RevisionEntity and RevisionListener to store additional information like username, ip in the revision info. It works fine. As a new ...
0
votes
1answer
60 views

Is it possible to use hibernate envers @Audited with r2dbc?

I hope to achieve auditing of my tables using @Audited annotation of the Hibernate Envers project while I'm using Spring Data R2DBC or plain R2DBC to insert data into my tables. Is this even ...
0
votes
0answers
59 views

Does the property hibernate.enable_lazy_load_no_trans works when getting a lazy field of an instance fetched from the audit table?

We are using hibernate-envers to log the events, and we are using the api AuditReader for searching instances from the audit tables. To get a lazy field when the session is not opened, we used to add ...
0
votes
1answer
70 views

Setting the revision date manually with Hibernate Envers

As far as I know, Hibernate Envers stores a revision when you create, change or delete an object annotated with @Audited. Envers sets automatically the revision date to the current time. Is it ...
0
votes
1answer
30 views

Hibernate envers customs table

I am migrating a old project to a new tech stack without changing the database model(I know that is bad but no option). So I already have a audit table defined which has data as well. Can I use the ...
0
votes
1answer
11 views

Does Envers support @Columns

I am setting up our environment to use Hibernate-Envers 5.3.3 and we are using Java 1.8.0_181. We have existing tables that already have data. I have most of the table auditing working just fine, ...
0
votes
1answer
19 views

How can we audit a field of an entity according to a condition?

To audit an entity conditionally, there is the option of using the Integrators and extends Envers event liteners. But can we audit a field or a property conditionally ? In our case , we have a blob ...
0
votes
1answer
128 views

Hibernate Envers Custom Listener not working with Spring Data JPA

I'm trying to implement custom revision entity with my Spring application to add username in the revision table. But the revinfo table is only having rev and revtstmp columns, the username column is ...
0
votes
1answer
32 views

Fetching all changes made by a user in hibernate envers

In hibernate envers, I can get all changes made to an entity by using the following piece of code: AuditQuery aq = auditReader.createQuery().forRevisionsOfEntityWithChanges(DummyEntity.class, false); ...
0
votes
1answer
101 views

Envers audit table does not rollback in spring-boot integration tests annotated with @Transactional

I am trying to figure out why @Transactional does not rollback data in envers audit table after each test and how to fix it. How can I make that happen in spring integration tests? I have tried with ...
0
votes
1answer
58 views

Is there any way to audit , with hibernate-envers, an entity having an @Embedded in its EmbeddedId

I have an entity BlocRecord having a composite code BlocRecordId, and in its composite code there is an @Embedded (relation code ManyToOne) pointing to another entiy Record and want to Audit the ...
0
votes
1answer
66 views

How to Audit one-to-one relation through hibernate envers in bidirectional?

I am using hibernate envers for auditing. I have two entity classes, A and B. There is a one-to-one relationship between them. So this creates two audit tables A_aud and B_aud. Creation/Updates for ...
0
votes
1answer
31 views

Hibernate, change the updatedTimestamp of child records on changes in parent records

I have a spring boot application with with Hibernate. I have the following tables. @Entity public class Application1 { @JoinColumn(name = "form_id") @OneToOne Form form; @Column @...
0
votes
1answer
161 views

Audit: Parent entity revision on child modification (Javers/Envers/… + Hibernate)

I have a kind of parent object in my application which needs to be versioned (audited), by that I mean: Every time an alteration on it is persisted, or on any of its n-deep child objects, a new ...
0
votes
2answers
178 views

How to get JIRA like change history using hibernate envers audit log?

I am trying to show JIRA like change history on UI. I am using Spring Data JPA and I have configured audit trail with Envers (v5.3.7). I can get list of all revisions using AuditQuery, for a ...
0
votes
0answers
52 views

Hibernate Envers can't resolve audit table

I have a JPA entity which I want audited. I added Envers to my project, and added the @Audited annotation to the entities I need. Now, the changes are being logged in the audit tables, but I cannot ...
0
votes
1answer
53 views

How to get audit revisions of Many To Many joined table using Envers audit query

I have two domains (User, Role). Both are in many to many relationship. hibernate auto generated 3 tables (User, Role, UserRole). I have integrated hibernate envers for auditing purpose. I am able ...
0
votes
0answers
56 views

Native query doen't work from crudRepository- spring?

There is application on spring, jpa, hibernate-envers(history) I have two table UserRecord and UserRecord_AUD(create by hibernate-enver) In Jpa I have crudRepository to read data from database. My ...
0
votes
1answer
33 views

How to audit into different database (Hibernate/Envers)?

I use Hibernate Envers to audit dataBase Change. How to audit(Store) Hibernate Envers Audit Table into different DataBase?
1
vote
1answer
59 views

Hibernate Envers: AuditQuery for selecting entity valid at given point in time

I use Hibernate Envers with ValidityAuditStrategy. I want to select the version of an entity as it existed at a given point in time. My revision info looks like this in SQL: create table revinfo ( ...
0
votes
1answer
32 views

How to make method in crudRepository to find any elements using list ids?

There is application on Spring + jpa + jpa Crud repository + hibernate-envers So, I have a table UserRecord with any fields Table UserRecord id name surname age version Table ...
0
votes
0answers
34 views

@PreUpdate on child that modifies parent property does not trigger revision of parent entity

I'm using Hibernate Envers to audit two entities (parent and child with a OneToOne relation). Both entities have @Audited and auditing is working. When updating a property of the child, I would like ...
0
votes
1answer
78 views

pool connection doesn't have free connections when use hibernate - envers and get history?

There is application on spring4+jaxb+jpa+hibernate-envers works on websphere + oracle11g there are 2 java-methods, which make get history of User entity: Method getHistoryUser called from rest - ...
0
votes
1answer
100 views

Hibernate Envers: Auditing with Embedded class in Composite Key

I am trying to activate auditing on a JPA entity with Hibernate Envers (curret version: 5.4.1.Final). Problem: The entity has an composite key (@EmbeddedId) and the key class has an @Embedded class ...
1
vote
0answers
34 views

Can envers audit changes across the entire hierarchy of parent/child tables?

I have seen this question asked on other forms dated back in 2012 but its now 2019 and I am having this same issue with envers. Has anyone figured this out?!?!? I am reposting this question from here:...
2
votes
0answers
156 views

What is envers @AuditMappedBy() supposed to do?

I am using Hibernate-Envers 4.3.11 Final I see that the documentation says: To properly audit such relations with Envers, you can use the @AuditMappedBy annotation. It enables you to specify ...