Hi!
I use Hibernate version 3.2.0cr2.
Can it happen that the uniqueResult() method returns null in the following code ?
Code:
protected static int rowCount(Criteria crit) {
crit.setProjection(Projections.rowCount());
return (Integer) crit.uniqueResult();
}
If the criteria matches zero rows, then after the projection it should return an Integer value of zero, right ?
I ask because in some cases it returns null (and by that causes a null pointer exception) in our application.
Thanks and regards,
David