sizeSafe = true;
if ( criteria instanceof CriteriaImpl ) {
CriteriaImpl impl = (CriteriaImpl) criteria;
//restriction of sub criteria => suspect
//TODO some sub criteria might be ok (outer joins)
sizeSafe = !impl.iterateExpressionEntries().hasNext() && !impl.iterateSubcriteria().hasNext();
}
}
else {
sizeSafe = true;
isExplicitCriteria = false;