11 Replies Latest reply on May 23, 2013 11:39 AM by Adam Warski

    Can I mark an field as not audited even though the object of the field is an audited entity?

    Stefan du Fresne Newbie

      Firstly, apologies if this is a bug that has been fixed. Due to the app container I will be deploying into I have to use an old version of Hibernate before Envers was shipped with it, which means I'm using 1.2.2.GA-hibernate-3.3 of envers, with no better option in sight.

       

      So anyway, I'd like to be able to do something like this:

       

      @Audited
      public class Foo {
           /* some other audited data */
      
           @Audited(targetAuditMode = RelationTargetAuditMode.NOT_AUDITED)
           private Bar latestBar;
      }
      
      @Audited
      public class Bar {
           /* some audited data */
      }
      

       

      So I want to be able to audit the Bar class as you'd expect. And I'd like to audit the Foo class, as you'd expect. However, I want the latestBar field to not be audited.. in the sense that it shouldn't go get the data for Bar out of the bar_aud table, but instead should get it from the Bar table.

       

      Is this possible, or am I doing something specific enough that it's completely incompatible with a generic framework such as this?