3 Replies Latest reply on Jul 12, 2013 8:44 AM by Adam Warski

    Is it possible to get the audited field names and their values from the envers API?

    sandhya rani Newbie

      I know the audited class name(audited fields only not class), from that class is it possible to get the audited field names through envers API? Through reflections i achieved that but i need from envers API and at the same time i need that audited value.

      for example if we use the following query,

          

      AuditQuery query = getAuditReader().createQuery()

                  .forRevisionsOfEntity(MyEntity.class, false, true)

                  .add(AuditEntity.id().eq(id));

                  .add(AuditEntity.property("actualDate").hasChanged())

       

      from that, if the "actualDate" property is changed then class instance will return otherwise null but its not giving the value of the "actualDate" property. In envers API i checked, there is two methods like getPropertyNames(),getPropertyAuditingData(String propertyName) of the ClassAuditingData class.For us is it possible to use those methods? If possible how to use those methods.

       

      Thanks in advance