there are 19 pieces of data in total. When using PageRequest.of (page, limit) for paging query, as long as the limit parameter is greater than 19, it is found to be empty.
less than 19:00, function is normal.
@Test
public void t1() {
//ok
List<Employee> employees = employService.getEmployees(1,20);
System.out.println(employees.size());
}
< H2 > Service Code < / H2 >
public List<Employee> getEmployees(int page, int limit) {
return employeeRepo.findAllByStatus(1, PageRequest.of(page, limit));
}
< H2 > Dao Code < / H2 >
List < Employee > findAllByStatus (int status,Pageable pageable);