Spring Data JPA Paging and Sorting Examples with Thymeleaf

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 ธ.ค. 2024

ความคิดเห็น •

  • @CodeJava
    @CodeJava  4 ปีที่แล้ว +3

    Link to copy code examples and download sample project: www.codejava.net/frameworks/spring-boot/spring-data-jpa-paging-and-sorting-examples

  • @tanveersyed1049
    @tanveersyed1049 4 ปีที่แล้ว +7

    The best spring boot tutorial channel in youtube

    • @CodeJava
      @CodeJava  4 ปีที่แล้ว +1

      Thanks. Check out the full Spring Boot playlist: th-cam.com/video/B4IDlfT-53I/w-d-xo.html

    • @tanveersyed1049
      @tanveersyed1049 4 ปีที่แล้ว

      @@CodeJava your code is very crystal clear ... Superb....

  • @brazo98
    @brazo98 3 ปีที่แล้ว +1

    You are the Spring Boot DUDE 🖖🏻🖖🏻🖖🏻🖖🏻🖖🏻🖖🏻🖖🏻🖖🏻🖖🏻🖖🏻🖖🏻🖖🏻🖖🏻

    • @CodeJava
      @CodeJava  3 ปีที่แล้ว

      Greetings from my desktop :) Thanks for watching.

  • @nguyenbakhoi8157
    @nguyenbakhoi8157 2 ปีที่แล้ว +1

    Cảm ơn anh đã chia sẻ kiến thức tới mọi người. Chúc anh sức khỏe, thành công! ^_^

    • @CodeJava
      @CodeJava  2 ปีที่แล้ว +1

      ko có gì em. Cảm ơn em :)

    • @CodeJava
      @CodeJava  2 ปีที่แล้ว +1

      @@nguyenbakhoi8157 em đọc bài viết này: www.codejava.net/frameworks/spring-boot/spring-data-jpa-paging-and-sorting-examples

  • @iandmetick07
    @iandmetick07 2 ปีที่แล้ว +1

    Amazing Resource, I love the way you explain very in detail. Your tutorial help me get through my days. Thank you😀😀😀😀😀😀

    • @CodeJava
      @CodeJava  2 ปีที่แล้ว

      Glad I could help!

  • @swapnakadam1822
    @swapnakadam1822 2 ปีที่แล้ว

    I understood d pagination Very well..Thank u

    • @CodeJava
      @CodeJava  2 ปีที่แล้ว

      You're most welcome

  • @alejandroeliasdiazorellana257
    @alejandroeliasdiazorellana257 ปีที่แล้ว

    This exersice is very very cool, thanks a lot !!!!

    • @CodeJava
      @CodeJava  ปีที่แล้ว

      You're welcome!

  • @igeolasoji3513
    @igeolasoji3513 3 ปีที่แล้ว +1

    Sorting: 45:30

  • @amolsd8706
    @amolsd8706 3 ปีที่แล้ว

    Hey Dear thanks helpful video and nice explanation . Now I got to know pagination concept

    • @CodeJava
      @CodeJava  3 ปีที่แล้ว +1

      Glad to hear that

  • @hamdamboyurunov6034
    @hamdamboyurunov6034 4 ปีที่แล้ว

    You are awesome, bro. YOU are my FRIEND.

    • @CodeJava
      @CodeJava  4 ปีที่แล้ว

      Wow, thanks. Kindly share with video with your friends and colleagues.

  • @im_pkd
    @im_pkd 4 ปีที่แล้ว +1

    Very well explained !!

    • @CodeJava
      @CodeJava  4 ปีที่แล้ว

      Glad it was helpful! Kindly subscribe.

  • @innocentmukunzi6003
    @innocentmukunzi6003 4 ปีที่แล้ว

    Thanks. Well explained. Could you share your insight why css is only applied on index and not appearing on pages ?

    • @CodeJava
      @CodeJava  4 ปีที่แล้ว

      Sorry, I don't understand your question. Could you explain?

  • @MrCupcakes85
    @MrCupcakes85 3 ปีที่แล้ว

    Now how do you add pagination to other methods besides the findall method? For example I am using a Spring data JPA query called
    "List findByBusinessAccountInfo(BusinessAccountInfo businessAccountInfo);"
    But this does not support Pageable

    • @CodeJava
      @CodeJava  3 ปีที่แล้ว +1

      Simply add Pageable as the second parameter to that method.

    • @MrCupcakes85
      @MrCupcakes85 3 ปีที่แล้ว

      @@CodeJava Thanks for the quick reply! I have another question.. So I got everything done and I was able to get the Page using this method.
      However on another webpage I am having trouble getting the Page List when I use stream API. I am making a DAO call and using stream api with Collectors.toList which is returning me a List. I am unable to cast that to a page.. therefor I am not able to get a page reference doing this.
      Is there something else other then collectors.toList that will return me a page instead? I tried looking but can not find it

    • @CodeJava
      @CodeJava  3 ปีที่แล้ว

      @@MrCupcakes85 show me your DAO code

    • @MrCupcakes85
      @MrCupcakes85 3 ปีที่แล้ว

      This is from the DAO
      Page findByBusinessAccountInfo(BusinessAccountInfo businessAccountInfo, Pageable pageable);
      This is when I call it..
      Page page = chairRecordSL.findByBusinessAccountInfo(user.getBusinessAccountInfo(), pageable).stream().filter(x -> x.getChairNumber() == chairNumber).collect(Collectors.toList());
      The issue is Collectors.toList returns a list and not a page. I tried Type casting it to a page but it would not let me.
      I can return it as a list but then I wont get the page reference..

  • @jasper5016
    @jasper5016 4 ปีที่แล้ว +1

    Can you please cover complex queries or stored procedure execution with the REST web services?

    • @CodeJava
      @CodeJava  4 ปีที่แล้ว

      Hmm, kindly give me some time to think about that.

  • @ktn4
    @ktn4 4 ปีที่แล้ว +1

    Dạ cám ơn anh đã chỉ, tại em không dùng th:href = " @{ /css/style.css } " nên bị lỗi :P

  • @nihatismayilzade2076
    @nihatismayilzade2076 3 ปีที่แล้ว

    very good and nice Mr. thank you so much but how to do this operating with BOOTSTRAP???(for instance pagination process)

    • @CodeJava
      @CodeJava  3 ปีที่แล้ว

      kindly check this video: th-cam.com/video/_67pXB1JHTo/w-d-xo.html

  • @darkmafius2010
    @darkmafius2010 4 ปีที่แล้ว

    Thanks. You saved my day.

    • @CodeJava
      @CodeJava  4 ปีที่แล้ว +1

      Glad I could help!

  • @nmc4494
    @nmc4494 4 ปีที่แล้ว

    can i use only jdbc for paging?

    • @CodeJava
      @CodeJava  4 ปีที่แล้ว +1

      Sure, but it's not easy and quick as using Spring Data JPA.

  • @jorgelewin8465
    @jorgelewin8465 4 ปีที่แล้ว

    awesome, you´re a genius!

    • @CodeJava
      @CodeJava  4 ปีที่แล้ว

      Wow, thanks!

  • @nikhilbendre8953
    @nikhilbendre8953 3 ปีที่แล้ว

    Sir can I apply that html code in to JSP page

    • @CodeJava
      @CodeJava  3 ปีที่แล้ว

      No, because Thymeleaf is used for the view layer instead of JSP.

  • @vantainguyen1549
    @vantainguyen1549 3 ปีที่แล้ว

    Có cách nào số trang hiển thị giảm bớt đi không anh, ví dụ lấy lên dữ liệu cho 8 trang mà chúng ta chỉ muốn hiển thị 4 trang 1,2,3,4, khi ở trang 4 click vô next thì hiển thị trang 2,3,4,5. Rất vui nếu được anh reply comment. Em like video trước ^-^

    • @CodeJava
      @CodeJava  3 ปีที่แล้ว +1

      em xem video này nhé: th-cam.com/video/_67pXB1JHTo/w-d-xo.html

    • @vantainguyen1549
      @vantainguyen1549 3 ปีที่แล้ว +1

      @@CodeJava thực sự hữu ích, cảm ơn a đã rep cmt của e, cũng như những video hữu ích. Hi vọng a sẽ tiếp tục ra nhiều video hơn nữa!

    • @CodeJava
      @CodeJava  3 ปีที่แล้ว

      @@vantainguyen1549 cảm ơn em đã động viên anh :)

  • @majedabdullah1558
    @majedabdullah1558 4 ปีที่แล้ว +1

    You're great. You deserve more views.
    Thanks a lot.
    Can you please make a video in findUser by username using Thymeleaf please?

    • @CodeJava
      @CodeJava  4 ปีที่แล้ว

      You're welcome. So do you mean convention methods in Spring Data JPA?

    • @majedabdullah1558
      @majedabdullah1558 4 ปีที่แล้ว

      Code Java I don’t know whether it’s called convention method or not. But let’s assume you will find an employee from a list by searching his name. In Thymeleaf how would you take the input and pass it to the controller class in order to fetch specific user details.

    • @CodeJava
      @CodeJava  4 ปีที่แล้ว

      Hmm, I think it's something like search/filter function described greatly in this video: th-cam.com/video/Q4e_GydUjbs/w-d-xo.html

  • @manuelsanches8632
    @manuelsanches8632 4 ปีที่แล้ว +3

    very good example mister Code Java, congratulations.
    But if the page had more records it would show like this [First Previous 1 2 3 4 5 6 ... Next Last],
    It would be good if only the first three or four are shown, not all, so it would not show as many numbers
    [First Previous .. 3 4 5 6 .. Next Last], how would you do that master.

    • @CodeJava
      @CodeJava  4 ปีที่แล้ว

      Then the logic would be quite simple: in the for each loop, check value of the counter variable i like this: 4 < i < totalPages - 4 and show the links only if i satisfies that condition.
      Or you can use two for loop: the first count from 1 to 4, and the second counts from totalPages - 4 to totalPages.

    • @manuelsanches8632
      @manuelsanches8632 4 ปีที่แล้ว

      @@CodeJava Master Code Java I was testing according to your indications but I was not successful, you could do it in your same example, please. If you were so nice, thanks. :/

    • @Restyle23
      @Restyle23 4 ปีที่แล้ว

      @@CodeJava Can you please tell me where to use that Loop , In Thymeleaf or Controller. Can you please implement that logic.

    • @CodeJava
      @CodeJava  4 ปีที่แล้ว +1

      ​@@Restyle23 you should implement that logic in Thymeleaf. I will publish a video about this thing, okay?

    • @Restyle23
      @Restyle23 4 ปีที่แล้ว

      @@CodeJava Yes , please. Thanks.

  • @garimajain7051
    @garimajain7051 4 ปีที่แล้ว

    Sir th:each= i:${#numbers.sequence(1,totalpages)}
    Without thymleaf kaise karnge

  • @bka9705
    @bka9705 2 ปีที่แล้ว

    spring security course available?

    • @CodeJava
      @CodeJava  2 ปีที่แล้ว

      No, I don't have a separate course for Spring Security. I have this one: www.udemy.com/course/spring-boot-e-commerce-ultimate

    • @bka9705
      @bka9705 2 ปีที่แล้ว

      @@CodeJava thanks
      i

    • @bka9705
      @bka9705 2 ปีที่แล้ว

      @@CodeJava Hi one more junit tutorial available?

  • @HuyHoang-mr2ci
    @HuyHoang-mr2ci 2 ปีที่แล้ว

    Dear Nam, Could you please add me to your github repo of the course "Spring Boot E-Commerce Ultimate Course"? I asked you on Udemy but still heard from you

    • @CodeJava
      @CodeJava  2 ปีที่แล้ว

      Oh, I thought I replied you. What's your GitHub username?

  • @datpham0505
    @datpham0505 3 ปีที่แล้ว

    like video nhưng mà a có video về search pagination không

    • @CodeJava
      @CodeJava  3 ปีที่แล้ว

      here is it: th-cam.com/video/Q4e_GydUjbs/w-d-xo.html

    • @datpham0505
      @datpham0505 3 ปีที่แล้ว

      @@CodeJava tks so much ♥

  • @javjaksmoke6287
    @javjaksmoke6287 2 ปีที่แล้ว

    Hello Brother Why error PageRequest

    • @CodeJava
      @CodeJava  2 ปีที่แล้ว

      you need to import it from the right package: org.springframework.data.domain

  • @az910
    @az910 4 ปีที่แล้ว +1

    Thank you very much, can you post it on github pls ?

    • @CodeJava
      @CodeJava  4 ปีที่แล้ว +2

      Yes, soon

    • @az910
      @az910 4 ปีที่แล้ว +1

      Thanks a lot for your tutorials
      👌

  • @rajashekar5755
    @rajashekar5755 4 ปีที่แล้ว

    NAM please make videos on charts and graphs its my humble request

    • @CodeJava
      @CodeJava  4 ปีที่แล้ว

      I noted, man.

  • @funy2024-k8n
    @funy2024-k8n 4 ปีที่แล้ว

    chào anh muốn làm cái show Entries thì phải làm sao Anh

    • @CodeJava
      @CodeJava  4 ปีที่แล้ว

      em giải thích rõ hơn được ko?

    • @funy2024-k8n
      @funy2024-k8n 4 ปีที่แล้ว

      @@CodeJava là mình muốn thêm cái lengthMenu á Anh[ [5,10,25,50,-1],[5,10,20,50,"All"] á Anh

    • @funy2024-k8n
      @funy2024-k8n 4 ปีที่แล้ว

      @@CodeJava hiện cái show để kích vô 5 là record xổ dưới hay 10 .. đồ á Anh

    • @CodeJava
      @CodeJava  4 ปีที่แล้ว +2

      anh hiểu rồi. Anh sẽ làm một video hướng dẫn.

  • @ducdatnguyen9251
    @ducdatnguyen9251 4 ปีที่แล้ว

    Em cám ơn anh, vừa bị audit về phân trang bằng JPA mà ko trả lời được, xem video của anh xong bây giờ thì ko lo bị hỏi về pagging bằng JPA nữa rồi

    • @CodeJava
      @CodeJava  4 ปีที่แล้ว

      Great. Em đang làm lập trình ở đâu?

    • @ducdatnguyen9251
      @ducdatnguyen9251 4 ปีที่แล้ว +1

      @@CodeJava Em đang học FresherAcademy tại FPT anh ạ, khóa học của em xong rồi, hiện tại người ở đơn vị đang xuống phỏng vấn , nếu qua thì sẽ nhận vào đơn vị làm việc ạ.

    • @CodeJava
      @CodeJava  4 ปีที่แล้ว +1

      @@ducdatnguyen9251 good luck!

  • @manuelsanches8632
    @manuelsanches8632 4 ปีที่แล้ว

    @Code Java Master Code Java I was testing according to your indications but I was not successful, you could do it in your same example, please. If you were so nice, thanks. :/

    • @CodeJava
      @CodeJava  4 ปีที่แล้ว

      What error did you get? What did it behave?

  • @ducnguyen-on2yn
    @ducnguyen-on2yn 4 ปีที่แล้ว

    em cảm ơn anh về video ko bt Anh có thể cho em xin source code đc ko anh

    • @CodeJava
      @CodeJava  4 ปีที่แล้ว

      link: www.codejava.net/frameworks/spring-boot/spring-data-jpa-paging-and-sorting-examples

  • @karismatripathy3455
    @karismatripathy3455 4 ปีที่แล้ว

    Nice.. can you please share source code? it will help me....

    • @CodeJava
      @CodeJava  4 ปีที่แล้ว

      You can find the source code and sample project in this text-based tutorial: www.codejava.net/frameworks/spring-boot/spring-data-jpa-paging-and-sorting-examples

  • @thonghoangpham6085
    @thonghoangpham6085 2 ปีที่แล้ว

    can you tell me the difference between @RequestParam and @Param, why you use @Param and not @RequestParam

    • @CodeJava
      @CodeJava  2 ปีที่แล้ว

      The @Param annotation is used in repository interfaces, and the @RequestParam is used in controllers (it's optional). It's my mistake of using @Param in controller.

    • @thonghoangpham6085
      @thonghoangpham6085 2 ปีที่แล้ว

      @@CodeJava Thanks for your answer

  • @abdullahmiah2799
    @abdullahmiah2799 4 ปีที่แล้ว

    please share code

    • @CodeJava
      @CodeJava  4 ปีที่แล้ว

      you can find code in this tutorial: www.codejava.net/frameworks/spring-boot/spring-data-jpa-paging-and-sorting-examples