javers | JaVers - object auditing and diff framework for Java | JSON Processing library

 by   javers Java Version: javers-2.0.0-RC3 License: Apache-2.0

kandi X-RAY | javers Summary

kandi X-RAY | javers Summary

javers is a Java library typically used in Utilities, JSON Processing applications. javers has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has high support. You can download it from GitHub, Maven.

JaVers is the 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)?.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              javers has a highly active ecosystem.
              It has 1018 star(s) with 305 fork(s). There are 45 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 59 open issues and 599 have been closed. On average issues are closed in 28 days. There are 7 open pull requests and 0 closed requests.
              It has a positive sentiment in the developer community.
              The latest version of javers is javers-2.0.0-RC3

            kandi-Quality Quality

              javers has 0 bugs and 0 code smells.

            kandi-Security Security

              javers has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              javers code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              javers is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              javers releases are available to install and integrate.
              Deployable package is available in Maven.
              Build file is available. You can build the component from source.
              Installation instructions, examples and code snippets are available.
              It has 15112 lines of code, 1988 functions and 437 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed javers and discovered the below as its top functions. This is intended to give you an instant insight into javers implemented functionality, and help decide if they suit your requirements.
            • Extracts a snapshot from a JSON representation
            • Returns the set difference between the two sets
            • Deserialize a snapshot state
            • Returns a list of property names that are different from the previous snapshot
            • Applies mapping function to each element in the source array
            • Applies a mapping function to each value in the source multiset
            • Returns an unmodifiable multimipet with the given map function
            • Sets properties
            • Package private method
            • Applies mapping function to each element of the source array
            • Serializes the snapshot to JSON
            • Calculates a PropertyChange based on the given pair
            • Calculate changes
            • Searches for changes created
            • Deserialize a JSON value change
            • Build a list of concrete type arguments
            • Deserialize a JSON element
            • Calculate multiset changes
            • Deserializes from json
            • Returns a String representation of the properties
            • Apply query parameters to select properties
            • Decodes a property
            • Converts JsonElement to a multimap
            • Serialize to JSON
            • Calculates changes
            • Queries for all shadows in the given query
            Get all kandi verified functions for this library.

            javers Key Features

            No Key Features are available at this moment for javers.

            javers Examples and Code Snippets

            Provide author of javers .
            javadot img1Lines of Code : 4dot img1License : Permissive (MIT License)
            copy iconCopy
            @Bean
                public AuthorProvider provideJaversAuthor() {
                    return new SimpleAuthorProvider();
                }  

            Community Discussions

            QUESTION

            Getting a Commit returned after a commit with no changes
            Asked 2022-Apr-02 at 10:43

            If I commit the same entity twice, the first time with changes and the second time without any changes, I receive a Commit with a CommitId both times. The first one holds the changes, the second has a empty changes list.

            Is this behaviour intentional? I would expect to not get a CommitId for the second commit as there is no change and also no commit in the database. I got around the issue by checking if the changes list is not empty.

            My Repository

            ...

            ANSWER

            Answered 2022-Apr-02 at 10:43

            This is how Javers works, you can have empty commit (without snapshots), but you can't have no commit. This design is expressed in Javers API, when you call javers.commit() you get a Commit object and not Optional.

            Source https://stackoverflow.com/questions/71707949

            QUESTION

            How to keep Javers cache consistent in distributed environment?
            Asked 2022-Feb-20 at 07:44

            When using Javers and Spring Boot applications (with MongoDB) in distributed environments, I get incorrect auditing snapshots.

            How to recreate (assuming we have 2 servers) -

            1. Update an existing Document by sending a request on server 1
            2. Update the same Document by sending a request on server 2
            3. Update the same Document again by sending a request on server 1

            The last generated auditing data will contain previousValue as it was on request 1 and the currentValue as it is on request 3.

            Currently, I have fixed the issue by disabling javers cache by setting the following property javers.snapshotsCacheSize=0.

            Is there any way to keep javers cache consistent in distributed environments?

            ...

            ANSWER

            Answered 2022-Feb-20 at 07:44

            There is no such way. Javers uses local cache only. I didnt tested it but I dont think that adding a distributed cache layer would significantly speed things up. It would add additional overhead. But if you are interested in contributing that feature - we can talk about it here https://github.com/javers/javers/discussions

            Source https://stackoverflow.com/questions/71110093

            QUESTION

            Is it possible to change the javers history?
            Asked 2021-Nov-03 at 17:19

            I am working on a rest backend using spring boot/jpa. I also use javers to audit my JpaRespositories.

            I am not entirely sure, if javers is intended for this purpose, but in addition to auditing my jpa entities i would also like to be able to edit the history.

            For example, i would like to get a Shadow-Object from a certain date:

            ...

            ANSWER

            Answered 2021-Nov-03 at 17:19

            You can't do it. Javers' Snapshots are immutable by design.

            Source https://stackoverflow.com/questions/69822745

            QUESTION

            maven dose not download dependencies in pom.xml
            Asked 2021-Sep-15 at 03:45

            my pom.xml file:

            ...

            ANSWER

            Answered 2021-Sep-15 at 03:45

            You have told Maven that your project is only a POM artifact (which doesn't have code or need jars):

            Source https://stackoverflow.com/questions/69186807

            QUESTION

            MongoDB document version update issue with JaVers
            Asked 2021-Aug-29 at 08:23

            I was using Javers for mongoDB document versioning with springboot. It provides essential functionalities for versioning such as separate history collection called jv_snapshots, changed field list in Entity or ValueObject model for their versions. But I found an issue relevant to valueObjects, but not entities. As you know, the difference between entity and valueObjects is the unique id that identifies the entity, but valueObjects don't have such Id to identify their versions. Refer the following examples as I observed this issue in my use case.

            Let's take the following Entity and valueObject models for versioning.

            Invoice.java

            ...

            ANSWER

            Answered 2021-Aug-29 at 08:23

            If you don't care about ordering, change List to Set in the model. Alternatively, you can configure Javers to use the ListCompareAlgorithm.AS_SET feature.

            In Spring Boot, you can enable it by setting javers.algorithm: AS_SET in your application.yml.

            see https://javers.org/documentation/spring-boot-integration/#javers-configuration-properties

            Source https://stackoverflow.com/questions/68948507

            QUESTION

            Maven Fails To Find Dependency
            Asked 2021-Jun-29 at 13:28

            This is a really odd error that I am getting while doing a maven build. I am encountering an error like this:

            ...

            ANSWER

            Answered 2021-Jun-29 at 13:28

            I feel really silly about this now. It turns out someone uploaded something to our internal artifactory for commons-lang that was not really commons-lang. No idea how that happened, but it was a never-ending source of frustration for me. If anyone else ever sees something that doesn't make sense like this, compare the size of the jar in your .m2 folder with one downloaded directly from maven central. That would have saved me a lot of time.

            Source https://stackoverflow.com/questions/68068614

            QUESTION

            Retrieve only left, right, propertyName from the javers Change class
            Asked 2021-Jun-18 at 10:57

            I am using the following code to retreive the changes made to a version in my API response

            ...

            ANSWER

            Answered 2021-Jun-18 at 10:57
            List changes = javers.findChanges(jqlQuery.build()).groupByCommit();
            ValueChange valueChange = (ValueChange)changes.get(0).get().get(0);
            String property = valueChange.getPropertyName();
            Object originalValue = valueChange.getLeft();
            Object newValue = valueChange.getRight();
            
            

            Source https://stackoverflow.com/questions/68032929

            QUESTION

            How to use JaVers with Map?
            Asked 2021-Apr-02 at 08:50

            I have two maps that can be modified by different authors. In this particular use case, I have a limitation where I shouldn't use POJOs or Domain objects, only a Maps.

            ...

            ANSWER

            Answered 2021-Apr-02 at 08:50

            You can compare two top level Maps but you cant commit a map to Javers Repository (exception should be thrown) because Maps have no identifiers.

            Source https://stackoverflow.com/questions/66902842

            QUESTION

            Javers - Comparison ValueObjects which are null and object with empty list
            Asked 2021-Mar-18 at 19:35

            I have such class:

            ...

            ANSWER

            Answered 2021-Mar-18 at 19:35

            You can use Custom Types and CustomPropertyComparator. See the javadoc for CustomType:

            Custom Types are not easy to manage, use it as a last resort, only for corner cases like comparing custom Collection types.

            JaVers treats a Custom Type as a black box and doesn't take any assumptions about its content or behaviour. It's a "not modeled" type, somehow similar to unbounded wildcard

            Objects of Custom Type are compared by a CustomPropertyComparator. Registering this comparator is the only way to map a Custom Type.

            Custom Types are serialized to JSON using Gson defaults.

            see JaversBuilder#registerCustomType(Class, CustomPropertyComparator)

            Source https://stackoverflow.com/questions/66682851

            QUESTION

            Javers - comparison String, Collection and Boolean with defined rules
            Asked 2021-Mar-13 at 18:13

            I have 2 classes:

            ...

            ANSWER

            Answered 2021-Mar-07 at 19:01

            I solved my problem. it was enough to overwrite the interface CustomPropertyComparator.

            Source https://stackoverflow.com/questions/66497652

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install javers

            Clone our github repository. Build JaVers and run unit tests. Run the environment self-test, to check if JaVers is compatible with your JDK version.

            Support

            We'd love to get issues and contributions from you!. You can report a Bug or a Feature Request. Questions should be asked at stackoverflow.com. We'll answer them. Before you create an issue please read our Guidelines for Bug Reporting. JaVers is an open source project, so we are open to your contributions. Before you start, please read our Contributing Guide and see how to get your changes merged.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/javers/javers.git

          • CLI

            gh repo clone javers/javers

          • sshUrl

            git@github.com:javers/javers.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular JSON Processing Libraries

            json

            by nlohmann

            fastjson

            by alibaba

            jq

            by stedolan

            gson

            by google

            normalizr

            by paularmstrong

            Try Top Libraries by javers

            javers.github.io

            by javersJavaScript

            javers-admin-frontend

            by javersJavaScript

            javers-vs-envers

            by javersGroovy