mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
add a disabled state to users
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user