Tuesday, February 16, 2010

How to fetch total record count using Hibernate Criteria



Criteria criteria = getSession().createCriteria(getReferenceClass());

criteria.setProjection(Projections.projectionList().add(Projections.countDistinct("id"))