|
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.
|