public Number getTotalCount ( Criterion ... criterion ) throws HibernateException { Criteria criteria = getSession ( ) . createCriteria ( entityClass ) ; addCriterionsToCriteria ( criteria , criterion ) ; criteria . setProjection ( Projections . rowCount ( ) ) ; return ( Long ) criteria . uniqueResult ( ) ; }
Returns the total count of db entries for the current type .