public Collection<T> findInRange(final String propertyName, final Object minValue, final Object maxValue, final Integer offSet, final Integer maxResultSetSize) {
checkForHiveIndexedProperty(propertyName);
QueryCallback query = new QueryCallback() {
public Collection<Object> execute(Session session) {
HiveCriteria c = new HiveCriteriaImpl(session.createCriteria(getRespresentedClass()), getRespresentedClass());
if (ReflectionTools.isComplexCollectionItemProperty(getRespresentedClass(), propertyName)) {
c.createCriteria(propertyName)
.add(Restrictions.between("id", minValue, maxValue));
} else {
c.add(Restrictions.between(propertyName, minValue, maxValue));
}
c.setFirstResult(offSet);
c.setMaxResults(maxResultSetSize);
return c.list();
}
};
return (Collection<T>) transactionHelper.queryInTransaction(query, factory.openSession());
}