I am rather new to JPA 2 and it\'s CriteriaBuilder / CriteriaQuery API:
CriteriaQuery javadoc
CriteriaQuery in the Java EE 6 tutorial
I would like to
You can also use Projections:
ProjectionList projection = Projections.projectionList(); projection.add(Projections.rowCount()); criteria.setProjection(projection); Long totalRows = (Long) criteria.list().get(0);