Тёмный

Pagination & Sorting in REST API using Spring Data JPA 

Kris Foster
Подписаться 10 тыс.
Просмотров 19 тыс.
50% 1

Learn how to add pagination & sorting to your Spring Boot REST API using Spring Data JPA.
We create a web application using the spring starter (start.spring.io/). We then expose an API for books. We then use Spring Data JPA to add pagination & sorting to the API.
Check out the code on GitHub here: github.com/kri...
Don't forget to Subscribe here: / @krisfoster1

Опубликовано:

 

15 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 25   
@FedericoPedemonte
@FedericoPedemonte 2 года назад
Nice tutorial, thank you! I just had to add "spring.jpa.defer-datasource-initialization=true" in application.properties in order to make it work with Spring Boot 2.6.3
@HP_Tubcraft
@HP_Tubcraft 2 года назад
thanks! I just spent the last 30 mins on stack over flow and I thought... "well now let me just check the comment section" haha. Good job.
@sinurao1017
@sinurao1017 3 года назад
sweet and simple example to start with this concept, Hope you can cover complex with multiple table example
@themrsupermanto
@themrsupermanto 8 месяцев назад
Wow, thank you so much. Paginating with spring boot seems a lot easier than in Node, even with Prisma ORM.
@AfricanThinker86
@AfricanThinker86 8 месяцев назад
How would you make it so the getBooks method could be sorted in both descending or ascending order?
@HenrryWith2Rs
@HenrryWith2Rs 2 года назад
This was absolutely perfect. Exactly what I was looking for.
@xixReact
@xixReact 2 года назад
hey mate, thanks so much! This video was excellent, very clear and concise
@KaizokuOuOre
@KaizokuOuOre 3 года назад
I gotta commend you on your choice of books!! Awesome video too :)
@DaniilDenisov-ws5ov
@DaniilDenisov-ws5ov 3 года назад
That was very helpful for me! Thanks a lot!
@JunxHead
@JunxHead 2 года назад
how can i custom the respon of this "pageable": { "sort": { "empty": true, "sorted": false, "unsorted": true }, "offset": 4, "pageSize": 4, "pageNumber": 1, "unpaged": false, "paged": true }, "last": true, "totalPages": 2, "totalElements": 8, "size": 4, "number": 1, "sort": { "empty": true, "sorted": false, "unsorted": true }, "numberOfElements": 4, "first": false, "empty": false }
@alanflynn3612
@alanflynn3612 3 года назад
Excellent well done Kris
@waldemarjankowski4090
@waldemarjankowski4090 2 года назад
Can you show example how to do pagination with Pageable as parameter of controller?
@HorukTaras
@HorukTaras 2 года назад
Awesome video. Thanks!
@KrisFoster1
@KrisFoster1 2 года назад
Glad you enjoyed, thank you for watching!
@TheSdoWn
@TheSdoWn 3 года назад
10:24 is there a way to customize what data that pageable return? for example only content, pageNumber and pageSize
@michellecarter648
@michellecarter648 2 года назад
Great tutorial! Thank you.
@billionaires8123
@billionaires8123 2 года назад
Thank you this was a great tutorial and helped me a lot
@billionaires8123
@billionaires8123 2 года назад
How do you see what does the method accepts in 8:11
@gameplays997
@gameplays997 3 года назад
Thank you, that was helpful :)
@chips4real1
@chips4real1 2 года назад
I assume if i have another Requestparameter i can set how many items we get per page right?
@danielmethner6847
@danielmethner6847 2 года назад
He showed that in the video...
@alexizhernandez8011
@alexizhernandez8011 2 года назад
Yes. He didn't actually show how to do that in the video but you can do it. You would need another Optional maybe called size or count. Then you would pass that in where he put the hardcoded 5. That 5 was the number he set for count as a default with no option to change it.
@shubhammondal2803
@shubhammondal2803 3 года назад
Thank you, that was helpful.
@Nickel-W
@Nickel-W 3 года назад
Thank you, very helpful for me
@meshmuhammad6927
@meshmuhammad6927 3 года назад
I like your accent.
Далее
Spring Security: Spring Security + REST + JWT
1:52:13
Просмотров 47 тыс.
Spring Data JPA from 0-100 in 60 minutes
1:02:31
Просмотров 81 тыс.
Outsmarted 😂
00:20
Просмотров 2,3 млн
Spring Boot For Beginners - Pagination
15:47
Просмотров 9 тыс.
Spring Data JPA -Criteria Queries - The Full Guide
30:07
the right way to organise your code
17:33
Просмотров 199 тыс.
GraphQL Pagination Support in Spring for GraphQL
42:36