Hi all,
I'm trying to make following query to hibernate:
Code:
Criteria criteria = session.createCriteria(MyEntity.class);
criteria.setProjection(Projections.projectionList()
.add(Projections.min("revision"), "min")
.add(Projections.rowCount(), "rows")
);
List list = criteria.list();
I know that there are no instances of MyEntity in db. Not a single entity was created before I executed the query. The list() method returns me {{0, 0}}.
Does anybody know why the first element is 0 (zero)? It should be null because the table MyEntity is empty.
revision is int nullable property. When I make the same request using createSQLQuery it returns null for min(revision)
Hibernate version is 3.2.6.ga.
Thank you.