0 Replies Latest reply on Sep 24, 2015 1:37 PM by Nicolas Larcipretti

    Querying multiple types

    Nicolas Larcipretti Newbie

      Hi,

       

      I'm trying to develop a timeline using Hibernate Envers. To achieve that, I need to query for all changes in all types made in a specific date range. How can I do that?

       

      I already managed to query for changes made in a date range, but just for one type (MyClass.class) as follows:

       

      List<Object> changesList = this.getAuditReader().createQuery().forRevisionsOfEntity(MyClass.class, true, true)
                  .add(new AuditProperty<Long>(new RevisionPropertyPropertyName("timestamp")).between(1443041652078L, 1443103687050L))
                  .getResultList();
      

       

      My question is: is there any way to make this query retrieve other types (MyClass2.class, MyClass3.class,etc) along with MyClass.class? I need that so I don't have to query several types in separate and merge the results lists in the end, cause keeping a search pagination with such merge would be a P in the A...

       

      Any help would be veeeery welcome.

       

      Cheers