I have a simple REST service which access data with Spring boot CrudRepository.
CrudRepository
This repository already implements pagination and sorting capabilities l
Declare the below function in your repository [EDITED]
[EDITED]
Page findByIdBetween(Long start, Long end, Pageable pageable)
Then you can invoke this function from the instance of repository. Please refer the spring-data reference for further info..