Also using the Spring Data parameter would be an option. There you can specify the request and pass as the parameter "PageRequest", which indicates the page size and page number:
Page<User> users = repository.findAll(new PageRequest(1, 20));
To do this, you need to extend the PagingAndSortingRepository.
Also as an alternative for paging results.
Of course, under it, it uses Hibernate, Toplink, or any other JPA implementation that you configure.
frandevel
source share