final Session hibernateSession) {
if (query instanceof LimitQuery<?>) {
LimitQuery<T> limitQuery = (LimitQuery<T>) query;
Query hibernateQuery = buildHibernateQuery(limitQuery, hibernateSession);
if (null == limitQuery.getLimit()) {
return hibernateQuery.list();
} else {
final PageLimit limit = limitQuery.getLimit();
hibernateQuery.setFirstResult((limit.getPageNo() - 1) * limit.getPageSize())
.setMaxResults(limit.getPageSize());
return hibernateQuery.list();