Skip to content

Commit

Permalink
[backend] Fix wrong count for pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
RomuDeuxfois authored Sep 25, 2024
1 parent 209fddc commit 3cd4a85
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static <T> Long countQuery(
Specification<T> specification) {
CriteriaQuery<Long> countQuery = cb.createQuery(Long.class);
Root<T> countRoot = countQuery.from(entityClass);
countQuery.select(cb.count(countRoot));
countQuery.select(cb.countDistinct(countRoot));
if (specification != null) {
Predicate predicate = specification.toPredicate(countRoot, countQuery, cb);
if (predicate != null) {
Expand Down

0 comments on commit 3cd4a85

Please sign in to comment.