Issue Type: New Feature New Feature
Affects Versions: 4.1.6
Assignee: Unassigned
Components: envers
Created: 13/Mar/13 9:05 PM
Description:

Currently criterion of Related ID (AuditRelatedId) only supports "eq" and "ne" expressions. It's valuable to support other expressions, particularly "in" expression. For example, there are 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; }

If we are going to to search Employee change history within certain companies, With the "in" expression, the query criterion could look like this:
AuditEntity.relatedId("company").in(companyIds);

The workaround is to break down the search to several queries (one for each company) and sort the result by time manually. But then there will be pagination problem because it's not as easy as just specifying max result in the query.

Environment: JBoss 7.1.1 final, Hibernate 4.1.6 final, Oracle 11g or SQL Server
Project: Hibernate ORM
Labels: criteria query search
Priority: Major Major
Reporter: Jason Huang
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira