String query = buildQuery(parent, clazz, authUser, "id", true);
return (Long) session.createQuery("select count(*) " + query).setCacheable(true).uniqueResult();
}
public static PageInfo getPageInfo(Session session, PermissibleObject parent, Class<?> clazz, User authUser, int pageSize) {
PageInfo pageInfo = new PageInfo();
long rowCount = getRowCount(session, parent, clazz, authUser);
long lastPageNumber = new Double(Math.floor((double) (rowCount - 1) / pageSize)).longValue();
pageInfo.setTotalRowCount(rowCount);
pageInfo.setLastPageNumber(lastPageNumber);
return pageInfo;
}