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
With Spring Data Jpa, we can use this method:
/*
* (non-Javadoc)
* @see org.springframework.data.jpa.repository.JpaSpecificationExecutor#count(org.springframework.data.jpa.domain.Specification)
*/
@Override
public long count(@Nullable Specification spec) {
return executeCountQuery(getCountQuery(spec, getDomainClass()));
}