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
0 answers

Unable to retrieve the revision number for an entity with spring-data-envers findLastChangeRevision

Am trying to get the revision number using the findLastChangeRevision method in spring-data-envers. Am able to fetch the last entity but the revision is alwaysUNKNOWN. And the revision number and timestamp are empty and null respectively…
0
votes
2 answers

Numeric Overflow exception when calling findRevisions() or even custom audit query - spring-data-jpa with oracle

I'm struggling with exception since the past 4 days and being completely frustrated with it that I'm asking this question, I have referred various answers already on StackoverOverflow but they dont seem to have the issue as mine, so please don't…
0
votes
0 answers

How to add new column in audit table which maintains the version based on primary key ID of original entity with Hibernate Envers

How to add new column in audit table which maintains the version based on primary key ID of original entity with Hibernate Envers I have attached an example of original table and audit table with the column I intend to add and if possible I also…
0
votes
1 answer

Hibernate 6 Envers: How to customize audit table of an @ElementCollection of @CompositeType?

I'm migrating a project from Spring Boot 2.7.x to 3.0.x. One of my entities has a collection with a composite type: @Entity @Audited public class Specialist { @Id @GeneratedValue private Long id; @ElementCollection …
0
votes
0 answers

How to use EnversRevisionRepositoryFactoryBean.class andDataTablesRepositoryFactoryBean.class with @EnableJPAReposintories in spring data jpa project?

not able to use both EnversRevisionRepositoryFactoryBean.class in a project we already using DataTablesRepositoryFactoryBean.class import org.springframework.context.annotation.ComponentScan; import…
0
votes
0 answers

Create spring data envers audit table only at app start-up

Is there a property to be set in order to create only the spring data envers auditing tables when starting the application? Best Regards
0
votes
0 answers

Audit select statement using spring-data-envers

insert, update, delete are audited by spring-data-envers dependency, is there a way to audit as well select statements? Thanks
0
votes
0 answers

Auditing @OneToMany parent child relation with composite key and owner on single side not working

I have a parent child @OneToMany relation with the one side as owner. The relation is bidirectional. The reference table ParentChild has a composite key (parentId, childId) and has an additional attribute name. All changes should be audited by…
0
votes
1 answer

Find newest Revisions of Entities where timestamp is less than x

I've made a painting to illustrate my desired result: painting of the result I have a max timestamp that i pass to my backend and i want to return the newest versions of the Entities that have a timestamp that is less than the passed one. The passed…
0
votes
1 answer

Liquibase - envers inserts data in audit table

I am developing a spring-boot (2.4.5) application with envers to audit data. When I am using the app from scratch, all is fine. From app, I can save data in database tables, and envers is storing audit data in the audit tables. To database CI/CD, I…
0
votes
1 answer

Spring Boot + Spring Data Envers giving error on entityManagerFactory bean not initialised

I want to audit some tables in my project using Spring-Data-Envers but I am getting some errors. I have 2 spring boot projects,Claims and InsureConnect. InsureConnect is a dependency in Claims. Claims has Spring Data Envers dependency
swapnil skate
  • 83
  • 1
  • 9
0
votes
0 answers

Spring envers does not audit OneToMany relations

I'm currently struggling with Hibernate Envers in combination with Spring Envers support. I have a simple Connection entity that has a uni-directional OneToMany mapping with a set of Parameters. From my application point of view this is a composite…
Sven S.
  • 21
  • 3
0
votes
1 answer

Envers + Spring JPA: revinfo does not allow 'user' column

I set up Spring JPA + Envers (PostgreSQL) and annotated some entity classes with @Audited. I added my revinfo table because I want to log the account a change came from: @Entity(name = "Audit") @Table(name =…
nykon
  • 504
  • 4
  • 18
0
votes
1 answer

How can I write entity history records to another server?

I want write entity to server1, but entity history to server2, how do I config my datasource? Did anyone particular it?
0
votes
1 answer

How to query for historical data

I'm trying to implement the simple idea with Spring Data JPA and MySql. I have tables: ╔════╦═════════════════════╗ ║ Id ║ Question ║ ╠════╬═════════════════════╣ ║ 1 ║ Who are you? ║ ║ 2 ║ Whats your name? ║ ║ 3 ║ Where are…