![]() |
Developing REST API? Clients wants both sort & pagination?
That’s quite simple btw!
Since last few hours was trying to add this simple feature my Spring Boot project. In my project pagination was done using pageable
In this tutorial I’m gonna show how to achieve this.
Let’s copy the code from below:
public List<Model> getAllData(Pageable pageable){ List<Model> models= new ArrayList<>(); modelRepository.findAllByOrderByIdDesc(pageable).forEach(models::add); return models; } //Model = Your Model where you want to implement this feature.
That’s all! We’re done!
If you’ve any confusion please let me know 🙂

Do you have any video of that? I’d love to find out some additional information.
Unfortunately no, you can comment your issues here. Hope I can help.
Thanks!
Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me? https://accounts.binance.bh/ru-UA/register?ref=JVDCDCK4
Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?