Questions tagged [javers]

JaVers is a lightweight java library for auditing changes in your data.

What is JaVers

JaVers is a lightweight java library for auditing changes in your data.

We all use Version Control Systems for source code, so why not use a specialized framework to provide an audit trail of your Java objects (entities, POJO, data objects)?

Story of JaVers

When developing an application, we usually concentrate on the current state of the domain objects. So we simply instantiate them, apply some changes and eventually, delete them, not paying much attention to their previous states.

The challenge arises when a new requirement is discovered.

As a User, I want to know who changed this status, when the change was performed and what the previous status was. The problem is that both version and change notions are not easily expressible either in Java language or in the mainstream databases (although NoSQL document databases have an advantage here over relational databases).

This is the niche that JaVers fills. In JaVers, version and change are first class citizens.

Basic facts about JaVers

  • It’s lightweight and versatile. We don’t make any assumptions about your data model, bean container or underlying data storage.
  • Configuration is easy. Since we use JSON for object serialization, we don’t want you to provide detailed ORM-like mapping. JaVers only needs to know some high-level facts about your data model.
  • JaVers is meant to keep its data versioning records (snapshots) in the - application’s primary database, along with main data. We use some basic notions following Eric Evans DDD terminology like Entity or Value Objects, pretty much how JPA does. We believe that this is the right way to describe data.
  • JaVers is written in Java7 and can be run on JDK 7 or higher.

Licence

JaVers is released under Apache License Version 2.0.

Homepage

http://javers.org/

388 questions
2
votes
1 answer

In javers, can you add additional entries

When taking a snapshot of a particular entity, apart from timestamp, user who did the change, etc, I would like to add an additional custom field (ex: comment, which is not described in the entity). Is it possible with Javers when using the…
patri
  • 59
  • 9
2
votes
1 answer

Javers default ignore instead of default include

Is there a way to default ignore all fields except explicitly included in Javers? I'm trying to persist CGLib proxy objects, and it's picking up all of the CGLib fields along with the @Entity fields. So what I think would work better is ignore by…
Drizzt321
  • 993
  • 13
  • 27
2
votes
2 answers

Can not handle managed/back reference 'defaultreference' in jackson for composite key

Recently i got this error, can not handle managed/back reference 'defaultreference' in jackson for composite key I googled alot but found the below option to use, JsonManagedReference and JsonBackReference Reference But my situation is, Class…
Lathy
  • 879
  • 1
  • 8
  • 25
1
vote
0 answers

Javers retrieve the ListChange objects (It is giving only reference id for the objects and not actual object values)

Using Javers for the fetching historical data (Audit purpose) in Java Springboot. I have a entity which is having one to many relationship with other child entities. Below is the example what we are doing. Example…
1
vote
0 answers

Modeling legacy table with Hibernate and auditing with Javers

I'm trying to model with hibernate The following legacy table: CREATE TABLE `child` ( `parent_id` int(10) unsigned NOT NULL, `child_name` varchar(255) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT…
1
vote
0 answers

Javers fails after changing the primary key from long to UUID

I have just changed the primary key of an entity from long to uuid. Now, when I try to change an object, javers fails with an Exception. java.lang.IllegalArgumentException: Invalid UUID string: 7 at…
KarlsFriend
  • 745
  • 1
  • 4
  • 17
1
vote
0 answers

How to cleanup JaVers in Spring Boot Tests

I am running javers in a spring-boot application with mongodb. Autoconfiguration works fine and it is really easy to use. I am now trying to clean the javers collection on test setups like…
cgo
  • 11
  • 1
1
vote
0 answers

Javers JPA and DTO mapping

I am new to Javers and so far I like it. I have played with Envers but think I like Javers better. In our application we are mapping Entities to DTOs at the service layer. Javers have a method findShadows(query) which returns a List>…
Avec
  • 1,626
  • 21
  • 31
1
vote
1 answer

Javers Mongo Multitenancy Issue

My Spring boot application has a multitenancy architecture and I'm using Javers to audit some data models. The issue I'm facing is that Javers is not able to resolve the database based on my MongoDatabaseFactory implementation. So far I've tried…
1
vote
2 answers

How do I disable logging from javers?

Currently working in a large spring-boot application, it would be preferred to disable logging if possible to reduce noise. sample of the logs NFO org.javers.core.JaversBuilder mappingStyle: FIELD NFO org.javers.core.JaversBuilder loading…
1
vote
1 answer

What is causing a 3rd party domain object to throw an exception when saving in Javers/Spring Boot?

I am using javers 6.2.5 and Spring Boot 2.5.2. I am getting an IllegalArgumentException saying "argument should not be null". It is being thrown in GlobalIdFactory.createId(). I have figured out that one of our 3rd party domain objects is causing…
wxkevin
  • 1,634
  • 2
  • 25
  • 44
1
vote
1 answer

Javers Diff and Spring

I have simple Spring Boot 2.5.7 JPA application and want audit diff between some entities So my pom.xml include this dependency org.javers javers-spring-boot-starter-sql
LeshaRB
  • 1,345
  • 2
  • 23
  • 44
1
vote
0 answers

Javers with simple diff returning ENTITY_INSTANCE_WITH_NULL_ID with an abstract entity

**Exception is happening when trying to find simple diff but its not throwing exception if I change it to MappingStyle.BEAN ** **.withMappingStyle(MappingStyle.BEAN)** JaversException ENTITY_INSTANCE_WITH_NULL_ID: Found Entity instance 'Employee'…
Praneeth
  • 559
  • 9
  • 19
1
vote
0 answers

JaVers configuration for spring data JDBC

I am trying to use JaVers with Spring Boot project with Spring Data JDBC included. So, default JaversSqlAutoConfiguration.java do not fit which is for jpa hibernate. Could you please help to identify JaVers configuration for Spring Boot project with…
1
vote
0 answers

How do I use Javers to audit with a custom update method?

I would like to use Javers to audit queries other than save() and delete(). Here is my repo: @Repository @JaversSpringDataAuditable public interface SomeRepo extends JpaRepository { @JaversAuditable @Modifying @Query("Update…