Java Spring Boot - JPA - Hibernate - H2 - Paging and Sorting Repository

  Рет қаралды 11,007

CodeForgeYT

CodeForgeYT

3 жыл бұрын

Learn how to implement paging and sorting for your entities in 20min! Quick, simple guide that will help you start with Spring Data Paging and sorting repository in Java Spring Boot application. We will use JPA, Hibernate and H2 database. Keep Coding!
GitHub code for service: github.com/codeforgeyt/jpa-pa...
Follow //CodefForgeYT on:
FB: / codeforgeyt
Twitter: / codeforgeyt
GitHub: github.com/codeforgeyt
Instagram: / codeforgeyt

Пікірлер: 21
@ElizaMeloV
@ElizaMeloV 3 жыл бұрын
It was really helpful. Very well explained. Thank you!
@CodeForgeYT
@CodeForgeYT 3 жыл бұрын
Great to hear that! You are welcome. Keep coding!
@superlistCG
@superlistCG 3 жыл бұрын
That was really helpful. Thank you.
@pyteec_ua
@pyteec_ua 3 жыл бұрын
Thank you very clearly explained. Thanks a lot!!
@CodeForgeYT
@CodeForgeYT 3 жыл бұрын
I am glad you like it!
@abreurodrigo
@abreurodrigo 2 жыл бұрын
Amazing video, very clearly explained.Cngratulations!!!
@CodeForgeYT
@CodeForgeYT 2 жыл бұрын
Glad you liked it!
@svetaha2677
@svetaha2677 2 жыл бұрын
so cool explain !!!
@CodeForgeYT
@CodeForgeYT 2 жыл бұрын
Glad you liked it
@diegoprystupczukdev4725
@diegoprystupczukdev4725 3 жыл бұрын
Thanks! It was very useful
@CodeForgeYT
@CodeForgeYT 3 жыл бұрын
Happy it helped you!
@facts6824
@facts6824 3 жыл бұрын
nice work 👌
@CodeForgeYT
@CodeForgeYT 3 жыл бұрын
Thanks!
@n0ne
@n0ne 3 жыл бұрын
What if i have threr entities linked each other? Like: Country in which :id, name, people count list of cities, in city: id, name, list of regions, region: id, name. With relationship between them respectively. How can i implement a filter to search for everything? For example countryname = Armenia&regionname=example and to return me every single city from this entity?
@CodeForgeYT
@CodeForgeYT 3 жыл бұрын
Not sure what you mean, but if you mean relations like one to many or something like this, you need to make joins
@n0ne
@n0ne 3 жыл бұрын
@@CodeForgeYT Thank you, yea, i asked about this.
@matheussiegmund6244
@matheussiegmund6244 2 жыл бұрын
How does actually Spring know the values that have been assigned to the fields of the StudentPage class? There was neither explicitly created an object of this class (=new StudentPage()), nor even this class was annotated by one of stereotype annotation, for example @Component, which would allow Spring to create an object in the container and then inject its instance to the method. What kind of mechanism is responsible for creating an object of StudentPage class in method declared inside StudentService class in this case?
@CodeForgeYT
@CodeForgeYT 2 жыл бұрын
First thing is that findAll() method has 3 different overloads. We are passing pageable object to the studentRepository.findAll(pageable). If you will take a look on findAll(pageable) overloaded variant of the method you will see that in our case it returns Page. Also, our StudentRepository extends PagingAndSortingRepository and it is responsible for the implemenation of the findAll(pageable). If you want to see the specific queries that are executed you have to enable jpa logging using spring.jpa.show-sql=true
@matheussiegmund6244
@matheussiegmund6244 2 жыл бұрын
@@CodeForgeYT Thanks for explanation bro. It’s a pleasure to be a part of community you have made!
@CodeForgeYT
@CodeForgeYT 2 жыл бұрын
@@matheussiegmund6244 You are welcome. Thank you too!
@GosuMania
@GosuMania Жыл бұрын
Can i use Pageable with CriteriaBuilder? I have checked this video: kzbin.info/www/bejne/rXulcnmQq8R-hJI but you stub number page and total records :(
Spring Data JPA from 0-100 in 60 minutes
1:02:31
VMware Tanzu
Рет қаралды 81 М.
Final muy increíble 😱
00:46
Juan De Dios Pantoja 2
Рет қаралды 47 МЛН
World’s Deadliest Obstacle Course!
28:25
MrBeast
Рет қаралды 156 МЛН
LOVE LETTER - POPPY PLAYTIME CHAPTER 3 | GH'S ANIMATION
00:15
100+ Linux Things you Need to Know
12:23
Fireship
Рет қаралды 56 М.
Domain-Driven Design with Relational Databases Using Spring Data JDBC
1:10:30
Final muy increíble 😱
00:46
Juan De Dios Pantoja 2
Рет қаралды 47 МЛН