1 Reply Latest reply on Feb 24, 2012 2:28 PM by Adam Warski

    Receiving RevisionEntity elements for an entity

    Christian Beikov Newbie

      Hello there!

       

      I am still new to envers and I would like to receive the revision entities for an entity, but I can't find a method that offers me that. Right now I use the following code to get something simmilar:

       

       

              AuditReader reader = AuditReaderFactory.get(em);
              List<Number> list = reader.getRevisions(Document.class, documentId);
              Map<Number, Date> versionMap = new HashMap<Number, Date>();
             
              for(Number n : list){
                  versionMap.put(n, reader.getRevisionDate(n));
              }
             
              return versionMap;

      I am afraid of a lot of database queries that will be made if I use it like that, so is there a different solution or not?