1 Reply Latest reply on Aug 7, 2012 8:07 AM by Adam Warski

    During Audit retrival How to exclude last updated record for each Id

    venkat.avala Newbie

      I am new to Evers. I have an Employee Entity (Table Name as IT_Employee with Employee_ID as the Primary Key) and with Envers all the audit changes that are performed on an entity are storing in IT_Employee_hst table.

      I am using the below Query to retrieve the Modified History on the Employee Entity.

       

              AuditReader auditReader = AuditReaderFactory.get(getSession());

              RevisionType[] revisionTypes = {RevisionType.MOD};

              AuditQuery query = auditReader.createQuery().forRevisionsOfEntity(Employee.class, false, true);

              query.add(AuditEntity.revisionType().in(revisionTypes));

              List returned = query.getResultList();

       

       

      Question:- The above query fetches all updates for all the Employees .

      I wanted to exclude the Last Modified Record for Each Employee (Employee_ID) .Please help me on this.