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

given javaClass 'class com.google.gson.JsonObject' is mapped to ValueType, expected ManagedType

Hi I am getting below error when i am using Javers.compare(oldDoc, newDoc) . Its working fine if inside document no any data with ArrayList Error :- given javaClass 'class com.google.gson.JsonObject' is mapped to ValueType, expected ManagedType
user3040299
  • 51
  • 1
  • 5
2
votes
1 answer

CustomValueComparator not called, when attribute is null in oldVersion

I'm using Javers to compare two object having a String attribute. Since in my application an empty String and a null value in that attribute must be treated equal, I wrote a CustomValueComparator and registered it for the java.lang.String class. But…
Moe
  • 23
  • 5
2
votes
1 answer

Javers compare entity to DTO

i'm new to Javers, and i`m currently using it to create a patch update for my entity. But i'm having some struggle with one specific scenario I want to compare a Entity against a EntityDTO/VO and get only the changes in values, the current…
2
votes
1 answer

JaVers detects changes in childs if simple property in root object is changed

I use Kotlin and I am trying to compare two complex objects (with multiple cycles) with JaVers. These objects use multiple Id-Properties. Therefore I created Id-Classes to have a single Id-Property for every class. In the Id-Classes I also use…
asuras
  • 123
  • 7
2
votes
1 answer

Compare only specifically annotated properties with JaVers?

I have the following domain model. NB Jackson @JsonView annotations for the fields: public interface JSONInvoiceBasicView { } public interface JSONInvoiceWithLinesView extends JSONInvoiceBasicView { } public interface…
TomR
  • 2,696
  • 6
  • 34
  • 87
2
votes
1 answer

Javers not creating snapshot for changes in object attributes inside a collection

I am evaluating javers to use it for auditing entities. I have an Entity with nested collection of ValueObjects.I expect each attribute change on the valueobject to generate a snapshot of the Entity.Snapshot is created only when a valueobject is…
Swamy
  • 21
  • 4
2
votes
1 answer

JaVers not detecting changes to object attributes inside a collection

I would like to use JaVers to track changes of my Java objects. The basic examples are working fine, but I can't get it to detect changes on objects stored in a collection. If I extend the ChangeLogExample.class example to change e.g. one of the…
user330315
2
votes
3 answers

How to initialize Javers jv_snapshot with current state if the database is already in use?

I have an already populated SQL database where I would like to add Javers auditing. Is there a way to initialize the jv_snapshot table with the current state of objects prior to running the initial update on a specific object? I find that I am…
2
votes
2 answers

Javers collection comparision with details about parent

Using Javers 3.0.2, I need to compare collections of complex objects being nested fields in a object, sometimes it can be even list of elements inside of another list of elements and so on. I'm using Levenshtein list comparision, and it requires…
Denis
  • 31
  • 4
2
votes
2 answers

javers: Identify or avoid duplicate diff results

I am comparing two objects containing a list of objects,using JaVers v3.0.0. The objects I am comparing differ in the contents of the list, for example an object is removed from the list. I am getting two change objects when I perform this…
UWiss
  • 21
  • 2
2
votes
2 answers

Comparing maps using Javers

How can I compare two maps containing Entity objects by id,properties using JaVers? I would like to detect that the Bob changes city from London to Paris in the following: public void compareMaps() { Javers javers =…
cmadsen
  • 354
  • 4
  • 19
2
votes
1 answer

Javers MongoRepository throwing IllegalArgumentException for Boolean JsonPrimitive

I'm trying to setup Javers using a MongoDB repository. I'm using version 2.9.1 for both javers-core and javers-persistence-mongo. However, when I try to commit an entity with a Boolean field, the following exception is…
user7454033
2
votes
2 answers

Javers - Track Child Object's Changes from Parent Object in Single Query

I've the similar use-case as described in https://github.com/javers/javers/issues/98 . In the code below, when I update the dependent object, and commit the Employee bob, I want the changes to dependent to retrieve from JQL query…
gtiwari333
  • 24,554
  • 15
  • 75
  • 102
2
votes
2 answers

Ability to purge old data

Is it possible to purge historical data in Javers? Let's say I had no interest in keeping any audit data which is older than one year (month, etc.). I could not find any similar API in Javers but is there at least a theoretical possibility of…
mindas
  • 26,463
  • 15
  • 97
  • 154
2
votes
1 answer

How to use Javers to diff two object of same entity class but with different Id

From Javers.org Each Entity instance has a global identifier called InstanceId. It consists of a class name and an ID value. Comparing strategy for Entity references is based on InstanceId and for Entity state is property-by-property. Entity can…
yanyatong
  • 23
  • 5
1 2
3
25 26