我想在规范中按条件查询分组不同的字段,但是当我发送request时,存储库给我分页了数据,其总元素等于我的请求大小(默认= 20) 我无法对其进行分页`
return new Specification<SubProject>() {
@Override
public Predicate toPredicate(Root<SubProject> root,
CriteriaQuery<?> criteriaQuery, CriteriaBuilder criteriaBuilder) {
criteriaQuery.distinct(true);
criteriaQuery.orderBy(criteriaBuilder.desc(root.get("updatedDate"))).distinct(true);
Join projectJoin = null;
List<Predicate> predicates = new ArrayList<>();
if (id != 0) {
predicates.add(criteriaBuilder.equal(root.get("id"), id));
} else {if (notSameProject) {criteriaQuery.groupBy(root.get("project")).multiselect(root.get("project")).distinct(true);
}`