2 Replies Latest reply on Mar 13, 2013 11:43 PM by jhuang8285

    Support "in" expression for AuditRelatedId

    jhuang8285

      Hi

       

      Thanks for Envers, we save a lot of effort on implementing our audit feature. Now I am working on searching audit data and realise that it's hard to search revisions based on relation condition. For example, I have domain objects like this:

       

      class Employee {
        private Integer id;
        private Company company; //many to one relation
        private String firstName;
        private String lastName;
      }
      
      class Company {
        private Integer id;
        private String name;
      }
      

       

      I would like to search Employee change history within certain companies. The query criterion could look like this:

       

      AuditEntity.relatedId("company").in(companyIds);
      

      However, the AuditRelatedId only supports "eq" and "ne" expression, which means I can't use the "in" expression on relation. It would be good to have such functionalities, or I have to break down the search to serveral queries (one for each company) and sort the result by time manually (but then I will  have pagination problem).

       

      I wonder if there's any plan on enhancing searching ability by relation property?

      Thanks.