- PageRequest.of替代new PageRequest
- Sort.by 替代new Sort
Sort sort = Sort.by(Sort.Direction.ASC,"name"); List list = new ArrayList(); list.add(new Sort.Order(Sort.Direction.ASC, "name")); Sort sort = Sort.by(list); PageRequest pageRequest = PageRequest.of(1,5,sort);