0 Replies Latest reply on Feb 27, 2014 9:15 AM by Amandine PINOIT

    Envers not auditing properties in super class and couldn't put property to @NotAudited

    Amandine PINOIT Newbie



      I am using Envers version 3.6.10.


      I have the following configuration :


      public abstract class V{

           protected string v;

           protected A a;



      this is a super class.



      public class Z extends V{





      public class A {

           protected V v



      The class' mapping Z contains the property of the super class V. The table Z_AUD contains this column too.

      When Z is audited, the property v is always a null value.

      In the class A mapping, the reference to the property V is a ManyToOne relation.


      1st :

      I want the property V v of the class A is not audited. I try these annotations @NotAudited, @Audit(targetAuditMode = relationTargetAuditMode.NOT_AUDITED) or @AuditOverride (name="v", isAudited = false")

      Nothing works. Envers want to audit V, but V is a superClass and can't be audited.


      2nd :

      I've tried to annotate the super class with @MappedSuperclass, the field v  in the class V annotated with @Audited, the field A a annoted with @NotAudited and the class I annotated with @Audited(auditParents = {V.class})

      Property v is still null.


      I have the following stacktrace :

      could not init listeners

      org.hibernate.Mappng An audited relation from A.v to a not audited entity V, such mapping is possible, but has to be explicitly defined using @audited(targetAuditMode = NOT_AUDITED).


      I have already try to put this annotation on this property and it changes nothing.