I saw that the Hibernate3 Migration Guide for 3.2
http://www.hibernate.org/250.html#A44 states that the return types for aggregation (count, sum, avg) functions have changed (The new type rules are described at
http://opensource.atlassian.com/projects/hibernate/browse/HHH-1538).
I have found with a Criteria query (see code below), applying a projection to the query, and specifying uniqueResult, the return type is still Integer?
1. Is this correct?
2. If not, can someone explain?
3. If correct, shouldn't it all be consistent (In this case return Long)?
Thanks.
Matt
Returns Integer (why not Long?)
Code:
Example exampleLightbox = Example.create(lightbox).ignoreCase();
Integer count = (Integer) session.createCriteria(ELightbox.class)
.setProjection(Projections.rowCount()).add(exampleLightbox)
.add(
Restrictions.eq("customerId", lightbox
.getCustomerId())).uniqueResult();