How to do a distinct count in JPA critera API?
You can use countDistinct on CriteriaBuilder
criteriaQuery.select(criteriaBuilder.countDistinct(entityRoot))
You can use countDistinct on CriteriaBuilder
criteriaQuery.select(criteriaBuilder.countDistinct(entityRoot))