描述:
总共数据为19条,使用PageRequest.of(page, limit)进行分页查询时,只要limit参数大于19,查出为空。
小于19时,功能正常。
Test Code
@Test
public void t1() {
//ok
List<Employee> employees = employService.getEmployees(1,20);
System.out.println(employees.size());
}
Service Code
public List<Employee> getEmployees(int page, int limit) {
return employeeRepo.findAllByStatus(1, PageRequest.of(page, limit));
}
Dao Code
List<Employee> findAllByStatus(int status,Pageable pageable);