danlz wrote:
Helo.
I'm using Hibernate 2.1.6.
I have a problem with foolowing code:
Criteria criteria = getSession().createCriteria(TemporaryReading.class);
criteria.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);
// Limit the result set
criteria.setFirstResult(firstRow);
criteria.setMaxResults(maxRows);
The problem is that Hibernate first limits the result and then eliminates duplicates.
Is there a way to do it in opposite order?
TIA
I'm pretty sure there isn't since the setFirstResult()/setMaxResults() modify the query and duplicates are removed on the back-end.