Hi All,
I use the Criteria API a lot to filter lists that are based on related objets and fields. I use a (recursive ) method to add criteria by LEFT JOIN. For example, I have a field "person.address.streetname=Oakstreet". My code automatically creates the Criteria by creating subcriteria. Here is a snippet
if (fieldName.contains("."))
{
String[] fieldNameValues = fieldName.split( "\\.", 2);
Criteria subquery;
String prefix = fieldNameValues[0];
subquery = criteria.createCriteria(prefix,Criteria.LEFT_JOIN);
addCriterium( subquery, fieldNameValues[1], operator, value, sortCol, sortDir, critMap);
}
I want to achieve the same in my AuditQuery. But I cannot find a way to make sub-criteria. It there one? Or will this not be implemented in the near future?
Subqueries and joins aren't supported yet. They may be implemented in the future for the ValidityAuditStrategy, but that's not yet planned in any way.
Adam