Questions tagged [spring-data-envers]

Spring Data Envers offers the popular Repository abstraction of Spring Data to Envers revisions. This means you can query Revisions with the same mechanics as your main entities.

What is Spring Data Envers?

Spring Data Envers makes typical Envers queries available in repositories for Spring Data JPA. It differs from other Spring Data modules in that it is always used in combination with another Spring Data Module: Spring Data JPA.

What is Envers?

Envers is a Hibernate module that adds auditing capabilities to JPA entities. This documentation assumes you are familiar with Envers, just as Spring Data Envers relies on Envers being properly configured.

GitHub Repository: https://github.com/spring-projects/spring-data-envers

Project Page: http://projects.spring.io/spring-data-envers/

Reference Documentation: https://docs.spring.io/spring-data/envers/docs/current/reference/html/

The underlying Envers project: http://hibernate.org/orm/envers/

61 questions
0
votes
1 answer

Hibernate Envers - how to search non audited entity

I store to database entity LOG which is immutable (doesn't change) but other classes (entities) which it includes can change do I have to annotate this one with @Audited (I mean log)? This creates extra table of history which doesn't make any sense…
0
votes
1 answer

RevisionRepository return entity with different List implementation (PersistanceBag ->ListProxy)

org.springframework.data.repository.history.RevisionRepository Entity entity = repository.findLastChangeRevision(entity.getId()).get().getEntity(); return entity with list as ListProxy. Normal CrudRepository repository.findById(id) return the same…
0
votes
1 answer

Querying revisions of nested object using spring-data-envers

I'm trying to implement entity auditing in my Java Spring Boot project using spring-data-envers. All the entities are being created as they should, but I've come up against a brick wall when executing the…
0
votes
1 answer

Hibernate Envers how to get the log history properly?

i create a table audit log using Hibernate Envers, and i use Spring Data Envers as my library, when i save/update/delete it successfully saved the log in my autid_log table, but when i want to retrive the log data, i got infinite loop of error, how…
Ke Vin
  • 3,478
  • 11
  • 60
  • 91
0
votes
2 answers

Moving auditing table with java envers to new database instance

I have a Mysql DB, schema name "myschema". This schema has tables, where some of this tables are audit tables. This is my dependency on my java project. org.hibernate hibernate-envers
0
votes
1 answer

How to catch errors in Envers?

I have set my auto updating of tables to none spring.jpa.properties.hibernate.hbm2ddl.auto=none That way when I am running Envers I will have to create the audit tables on my own. However when I have set an entity to be audited with the @Audited…
0
votes
1 answer

Hibernate Envers Audit Query- retrieve only the most recent revision for all entities

I would like to retrieve the all recent versions of all entities( i.e. everything in Database) that has changed recently. Following query fetch revisions of specific entity "MyEntity" queryObject =…
Satyam
  • 703
  • 6
  • 20
0
votes
2 answers

Envers NullPointerException when creating test data

I am brand new to Envers - started today. I am extending an existing Spring Boot application with Audit support using Envers. I annotated all @Entity classes and made some changes, as described here Envers + MYSQL + List =…
Alex
  • 1,387
  • 2
  • 9
  • 14
0
votes
1 answer

Envers + MYSQL + List = SQLSyntaxErrorException: Specified key was too long;

I am extending an existing application with Audit support using Envers. I annotated all @Entity classes and I got a bunch of Exception traces. When taking a look at them, it seems that they all relate to attribute definitions that have the…
Alex
  • 1,387
  • 2
  • 9
  • 14
0
votes
0 answers

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") @Audited @AuditTable(value =…
Ravi
  • 1,082
  • 4
  • 15
  • 24
0
votes
1 answer

How to fill audit fields that are in Audit extendable entity mapped super class?

I'm using hibernate envers to audit my entities. I have OfficeEntity like this: @Entity @Audited @EntityListeners({AuditingEntityListener.class}) @Table(name = "office") @AuditTable("office_aud") public class OfficeEntity extends Auditable{ …
0
votes
1 answer

Spring Data Envers - PropertyReferenceException: No property findRevisions found for type Foo

I do have a Sprint-Boot application and try to add hibernate-envers or to be more specific spring-data-envers to the project. So I added org.springframework.data
Pwnstar
  • 2,333
  • 2
  • 29
  • 52
0
votes
0 answers

How to avoid slow request to use envers at Spring boot

I am using envers at Spring boot project. @Repository public interface DataAudRepository extends RevisionRepository, JpaRepository { } If there is numerous data on the data_aud table (data number : 3500),…
0
votes
1 answer

JPA Inheritence For Entity History Persistence

We have a requirement to persist into separate tables history records for our entities. I looked into Envers but the REVINFO table is a problem for retrofitting existing customers and performance. I was thinking of an approach where we have each or…
Mike Rother
  • 591
  • 4
  • 16
0
votes
1 answer

Bi temporal audit data with JPA Envers

We have an application that tracks all the  entity changes with bi-temporal data. Each entity has: @Embeddable public class AuditInfo { private Date effectiveFrom; private Date effectiveTo; private Date asOf; private Boolean…
A.U
  • 51
  • 6