7 Replies Latest reply on May 29, 2011 3:20 AM by Adam Warski

    Unexpected audit entries

    Amin MC Newbie

      Hi

       

      I have the following object model

       

      Class A {

      @OneToMany (cascade=CascadeType.ALL)

        Set<B> setOfClassB = new HashSet<B>();

       

      }

       

      @Audited

      Class B {

        String name;

         String value;

        @ManyToOne(cascade=CascadeType.ALL)

         @Audited(targetAuditMode = RelationTargetAuditMode.NOT_AUDITED)

         ClassA belongsTo;

      }

       

       

      Everything is ok. I can create an instance of classA with a set of audited classB's.  WHat is interesting is that if i update ClassA with any other data I get an entry update in the audit table for each entity classB saying an update occurred which is not correct as I only updated classA which is not audited.

       

      I presumed that if I get something out of the set and update that entity then there would be a new audit entry for entity B. 

       

      Am I missing some config set up?

       

      Any help would be appreciated.

       

      Cheers