1 Reply Latest reply on Aug 21, 2008 5:27 AM by Sebastian Komander

    Annotation to exclude specific fields from versioning

    nikodc Newbie

      Hello.

      I would like to suggest a new feature. I was thinking about the possibility to include another annotation to Envers in order to indicate that a specific field must not be considered for versioning purposes. The idea is to being able to specify something like:

      @Entity
      @Versioned
      public class Person {
       @Id
       @GeneratedValue
       private int id;
      
       private String name;
      
       private String lastName;
      
       @Unversioned
       private String address;
      
       private String email;
      
       ..... // many other fields plus getters and setters
      
      }


      In this scenario Envers should manage only the id, name and email properties ignoring the address property. This could be useful when you want to version entities with many properties ignoring a few specific ones. In the current context you must set the @Versioned annotation for each versioned property to solve this kind of situations.

      What do you think about this idea? Maybe something like this is already present in the framework. In that case, please, let me know how to use it.

      Thanks in advance.