0 Replies Latest reply on Aug 25, 2011 4:41 AM by desol4tion

    query on the last revision of my objects on a date

    desol4tion

      Hi,

       

      i would like to do the same thing :

       

      getAuditReader().createQuery().forRevisionsOfEntity(Clazz.class, true, false)

                              .add(AuditEntity.revisionProperty("timestamp").maximize().add(AuditEntity.id().eq(clazz.getId()))

                                      .add(AuditEntity.revisionProperty("timestamp").le(date))).getSingleResult();

       

      but i dont' want to do this for one instance of my class, so i don't want to specify the id because i don't know it and my result was a list. In fact, i would like to have the latest revision of all my object at a specific date :

       

      date 1 :   create obj1 (revision0)   create obj2 (revision1)

      date 2 :   update obj1 (revision2)

      date 3 :   update obj1 (revision3)

      date 4 :   update obj1 (revision4)


      I would like my query return me my objects at the date "date3" so i would like to have the revision 3 and the revision 1.

       

      Please help me. Thx