2 Replies Latest reply on May 22, 2011 2:17 PM by anonimo

    Additional value for RevisionType

    anonimo Newbie

      I have a use case where my API consumers can choose which type of RevisionType wants to fetch (MOD, DEL, ADD, ANY).

       

      When choosing either MOD, DEL or ADD there is no problem as Envers provides those values in the RevisionType entity, and that part of the query then looks like e.g.:

       

      .add(AuditEntity.revisionType()

                                                                  .eq(revisionType)

       

      However, when the user wants to fetch any type of revision of the three available, I have to create an additional query, where I remove the criteria specified above, leading to nasty pseudo code like:

       

      if(revisionType == ALL) {

       

      // query without the revisionType criteria

       

      }else{

       

      // query with the revisionType criteria

       

      }

       

      It would be great if the RevisionType enum had an option for retrieving any type of revision, something like:

       

      RevisionType.ANY