Is it possible to receive data in user ranges [int start record -int last record]?
In my case, the user will determine in the query line in which range he wants to receive data. I tried something like this
Pageable pageable = new PageRequest(0, 10); Page<Project> list = projectRepository.findAll(spec, pageable);
Where spec is my specific specification, but unfortunately this does not help. Maybe I'm doing something wrong here.
I saw other spring jpa methods, but nothing helped.
can the user enter something like this localhost: 8080 / Section / employee? Range {"ColumnName": name, "from": 6, "to": 20}
Thus, this suggests that to retrieve data about employees, he will retrieve the first 15 records (sorted by column name), at the moment it does not matter.
If you can offer me something better, that would be great. If you think that I have not provided sufficient information, please let me know, I will provide the necessary information.
Refresh . I do not want to use my own or create query requests (so far I have no other option). Maybe something like this:
Pageable pageable = new PageRequest(0, 10); Page<Project> list = projectRepository.findAll(spec, new pageable(int startIndex,int endIndex){
If you have the best options, you can also suggest me.
Thanks.
spring spring-data spring-jpa spring-mvc
Roxy
source share