DATAJPA-656 - Make sure SimpleJpaRepository.count(Specification) works with group clauses.

SimpleJpaRepository.count(Specification) now uses QueryUtils.executeCountQuery(…) to make sure we correctly treat Specifications with group-by clauses.
This commit is contained in:
Oliver Gierke
2015-02-10 18:54:44 +01:00
parent 760fbe90b3
commit d05d2233f0

View File

@@ -385,8 +385,7 @@ public class SimpleJpaRepository<T, ID extends Serializable> implements JpaRepos
* @see org.springframework.data.jpa.repository.JpaSpecificationExecutor#count(org.springframework.data.jpa.domain.Specification)
*/
public long count(Specification<T> spec) {
return getCountQuery(spec).getSingleResult();
return QueryUtils.executeCountQuery(getCountQuery(spec));
}
/*