2 Replies Latest reply on Apr 4, 2014 9:58 AM by fastlane

    Underlaying entity changed

    sebastiann

      Hi,

       

      Envers is really great at showing me the revisions of a given entity, but it doesn't let me know when a underlaying entity changed. I've googled and searched here but can't find anything suitable entry.

      e.g. the structure:

      @Audited

      public class MainEntity ...

      > @OneToOne

      > private OtherEntity otherEntity;

       

      @Audited

      public class OtherEntity ...

      > @OneToOne

      > private OtherInfo otherInfo;

       

      @Audited

      public class OtherInfo ...

      > String fooBar;

       

      public List<Object[]> findRevisions(Class<?> type) {

              // essentials

              AuditReader reader = AuditReaderFactory.get(this.em);

              return reader.createQuery().forRevisionsOfEntity(type, false, true).getResultList();

      }

       

      The fooBar String was changed over the MainEntity. The revision of OtherInfo was updated correctly. But how can I tell envers that the MainEntity revision update?

      Thanks in advance