add a disabled state to users

This commit is contained in:
Athou
2013-03-29 12:59:21 +01:00
parent 04ce8b3a3b
commit 60bcb64828
7 changed files with 83 additions and 13 deletions

View File

@@ -78,6 +78,20 @@ public abstract class GenericDAO<T, K> implements Serializable {
return criteria.getResultList();
}
public List<T> findAll(int startIndex, int count, String orderBy,
boolean asc) {
EasyCriteria<T> criteria = EasyCriteriaFactory.createQueryCriteria(em,
getType());
criteria.setMaxResults(count);
criteria.setFirstResult(startIndex);
if (asc) {
criteria.orderByAsc(orderBy);
} else {
criteria.orderByDesc(orderBy);
}
return criteria.getResultList();
}
public long getCount() {
CriteriaBuilder builder = em.getCriteriaBuilder();
CriteriaQuery<Long> query = builder.createQuery(Long.class);