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