public static < T > Long count ( EntityManager em , CriteriaQuery < T > criteria ) { return em . createQuery ( countCriteria ( em , criteria ) ) . getSingleResult ( ) ; }
Result count from a CriteriaQuery