1 Reply Latest reply on Jun 12, 2012 3:58 PM by adamw

    Using last and last validated revisions

    eschramm

      Hello

       

      I am considering using Envers in a new project I'm involved in, but I have just one question for which I couldn't find an answer :

      the elements of my database must be validated by, let's say, a superuser, before being available for some treatments (e.g., searching)

      So I have to be able to access the last revision of an entity (easy), but also the last validated revision, which could be the last or not.

       

      Is there a simple way to do this with Envers ? By simple, I mean of course without searching through the history of each element ...

       

      Thank you very much in advance for any response.

       

      Étienne

        • 1. Re: Using last and last validated revisions
          adamw

          You can create a query for an entity which has a certain property set and has a maximum revision number (maximize() in the query DSL).

          However note that you cannot modify historic entities.

           

          You are probably looking for a workflow-like solution, not sure if Envers is right here.

           

          Adam