public List<T> doInSession(Session session) { BeanQuery qry = session.from(sources).offset(from).limit(to - from).orderBy(order); if (condition != null) { qry.where(condition); } return qry.list(projection); } });
@SuppressWarnings("unchecked") private void prepare(Session session, int startIndex, int endIndex, List<SortConstraint> sortConstraints) { BeanQuery beanQuery = session.from(entityPath); beanQuery.offset(startIndex); beanQuery.limit(endIndex - startIndex + 1); if (sortConstraints.isEmpty()) {