return paginateQuery(query, params, limit);
}
@SuppressWarnings({ "unchecked", "rawtypes" })
public Page<?> paginateCriteria(Criteria criteria, PageLimit limit) {
CriteriaImpl criteriaImpl = (CriteriaImpl) criteria;
int totalCount = 0;
List<?> targetList = null;
if (null == criteriaImpl.getProjection()) {
criteria.setFirstResult((limit.getPageNo() - 1) * limit.getPageSize()).setMaxResults(
limit.getPageSize());
targetList = criteria.list();
Projection projection = null;
criteria.setFirstResult(0).setMaxResults(1);