/** * This is the default impl that comes with Kuali - uses OJB. * * @see org.kuali.rice.krad.dao.BusinessObjectDao#countMatching(java.lang.Class, java.util.Map, * java.util.Map) */ public int countMatching( Class clazz, Map<String, ?> positiveFieldValues, Map<String, ?> negativeFieldValues) { Criteria criteria = buildJpaCriteria(clazz, positiveFieldValues); criteria.and(buildNegativeJpaCriteria(clazz, negativeFieldValues)); return ((Long) new QueryByCriteria(entityManager, criteria).toCountQuery().getSingleResult()) .intValue(); }
/** * @see org.kuali.rice.krad.dao.BusinessObjectDao#findMatchingActive(java.lang.Class, * java.util.Map) */ public <T extends BusinessObject> Collection<T> findMatchingActive( Class<T> clazz, Map<String, ?> fieldValues) { Criteria criteria = buildJpaCriteria(clazz, fieldValues); criteria.and(buildActiveJpaCriteria(clazz)); return (Collection<T>) new QueryByCriteria(entityManager, criteria).toQuery().getResultList(); }