for (final Entry<String, CriteriaDecorator> entry : decoratorsByPojoPropertyName.entrySet()) {
queryGenerator.putDecorator(entry.getKey(), entry.getValue());
}
}
final OrderingCriteria criteria = queryGenerator.generate(query);
for (final Criterion criterion : criterions) {
criteria.add(criterion);
}
final int count = criteria.count();
if (!QueryMode.FULL_RESULT.equals(query.getQueryMode())) {
criteria.setMaxResults(query.getPageSize()).setFirstResult(query.getPageNum() * query.getPageSize());
}
final Result<List<T>> result = new Result<List<T>>();
result.setData(criteria.list());
result.setFullSize(count);
return result;
}