1 Reply Latest reply on Mar 1, 2011 5:43 AM by adamw

    Changes on @OneToOne association

    anonimo

      pHi,

       

      I have the following associations created:

       

      @Entity

      @Audited

      public class SomeClass {

       

       

                @OneToOne(cascade = CascadeType.ALL)

                @JoinColumn(name = "joincolumn")

                private AnotherClass clazz;

       

      }

       

      @Entity

      @Audited

      public class AnotherClass {

       

           private String name;

      ...

       

      }

       

      If I do:

       

      someClass.getClazz().setName("a new name");

       

      This causes a new revision of AnotherClass, but no new revision of the SomeClass entity. I would expect Envers to create a new revision of the "owner" and the "owned" relationships, as otherwise it will force me to implement the AnotherClass class fields as part of the SomeClass fields in order to get new revisions on its attributes changes.

       

      Modifying the


       

      org.hibernate.envers.revision_on_collection_change


      property doesn't seem to help.


      Any ideas if this is possible or am I doing something wrong here?


      Thanks.