Spring Data JPA -Criteria Queries - The Full Guide

Поделиться
HTML-код
  • Опубликовано: 27 ноя 2024

Комментарии • 98

  • @BoualiAli
    @BoualiAli  Год назад +1

    Join the Micro Services course waiting list and get and get an exclusive *EARLY-BIRD discount*
    aliboucoding.ck.page/d0f9317e13

  • @CoolBishop1997
    @CoolBishop1997 Месяц назад

    Jazaka llaho khayran

  • @supun_sandaruwan
    @supun_sandaruwan 10 месяцев назад

    I didn't even heard about criteria queries in spring boot. Thank you so much for sharing knowledge with us, Sir ❤🌻.

    • @BoualiAli
      @BoualiAli  7 месяцев назад

      Glad you liked it!

  • @yashkevich
    @yashkevich Год назад +2

    In the first case, the request will look like: select * from employee where (last_name = LIKE '%:lastName%' OR first_name LIKE '%:firstName%') AND first_name LIKE '%:email%') That is, the OR predicates will be in parentheses (1 OR 2) AND 3, since they are in a separate predicate

  • @4wrk
    @4wrk 7 месяцев назад

    Thanks a lot! Your guide helped me to avoid creation of bunch of unnecessary methods within my repo layer :)

    • @BoualiAli
      @BoualiAli  7 месяцев назад +1

      Glad it helped!

  • @attabou100
    @attabou100 2 года назад

    Exactly ; I repeated the video , and you explained very well when criteria is used ; thnaks a lot dear Teacher

  • @toufiqulislamimran7911
    @toufiqulislamimran7911 Год назад

    Man you are a life saver, till this video I didn't know about this feature of JPA. Thanks a lot man.❤❤

    • @BoualiAli
      @BoualiAli  Год назад +1

      Happy you liked it!
      You can also check the SPring Data JPA advanced course on my website aliboucoding.com/courses

    • @toufiqulislamimran7911
      @toufiqulislamimran7911 Год назад

      @@BoualiAli Thank you so much and Please make video on Unit testing

    • @BoualiAli
      @BoualiAli  Год назад

      @@toufiqulislamimran7911 soon

  • @spring8355
    @spring8355 2 года назад +5

    Thank you for your kind explanation, keep going ❤❤❤.
    Please, I would like to know what is the best practice for handling exception :
    extending "Exception" or extending "RuntimeException"

    • @BoualiAli
      @BoualiAli  Год назад

      You can check the exception handling video

  • @fatemehsalem3850
    @fatemehsalem3850 Год назад

    Thank you for providing this tutorial, it is so unique

  • @Teze-m8b
    @Teze-m8b 4 месяца назад

    Excellent tutorial

  • @kyrylochornobryvets3385
    @kyrylochornobryvets3385 4 месяца назад

    Hmm. Full Guide without joins and join fetch?! But you gave good approach. Thanks. It will be great if you create really full guide for Criteria Queries with joins and fetch joins and some queries which we don't know. 👍

  • @soumikdash2866
    @soumikdash2866 4 месяца назад

    Thank you very much sir really appreciate your effort.

  • @pqan112
    @pqan112 2 года назад +2

    Thanks so much teacher, I'm a newbie Springboot. I don't know how to create complete API with relationship between tables. Other tutorial videos just teach me how to create API based on an entity. I hope you can do a video about my problems, thanks

    • @BoualiAli
      @BoualiAli  2 года назад

      Enjoy this
      aliboucoding.com/p/first-hands-on-spring-boot-framework

    • @pqan112
      @pqan112 2 года назад

      @@BoualiAli Thank you so much teacher

  • @ShrivastavaMohit07
    @ShrivastavaMohit07 Год назад

    Great explanation

  • @rihabbensoula1016
    @rihabbensoula1016 2 года назад +1

    Great job ,keep going

  • @123cheke
    @123cheke 20 дней назад

    great video. Quick question, what about if email has underscore characters(_) ?

  • @atefjlassi193
    @atefjlassi193 Год назад

    Great, Thank you Bouali

  • @toufiklaggoune5972
    @toufiklaggoune5972 2 года назад

    Always the best. Keep going bro.

    • @BoualiAli
      @BoualiAli  2 года назад +1

      Thanks a lot.
      I will

  • @codewithtee
    @codewithtee 7 дней назад

    How can make the list be a custom Response, e.g EmplyeeResponseDto and also how do I query relation of Employee (e.g depeartment)

  • @geethikathota9063
    @geethikathota9063 Год назад

    Very helpful. Thank you so much.

  • @elkhanismayilov
    @elkhanismayilov 3 месяца назад

    Thank you for this tutorial but I have a question for that topic. How we can search to date range with criteria query. Would you explain or refer for me???

  • @ruff7209
    @ruff7209 Год назад

    Nice tutorial, thx man!

  • @nailiridha7179
    @nailiridha7179 2 года назад

    tres bien bravo

  • @arturszmer3336
    @arturszmer3336 Год назад

    Hey! Your tutorials are great but please do something with sound on introduction :) Just take mikrofon closer to you, if you want to hide your microfon you could place them under the view but close to you. Another way is bring more staff to you room to make reverb much smaller ;) If you need any advice about sound you can let me know.

    • @BoualiAli
      @BoualiAli  Год назад

      Thank you so much for the nice feedback.
      I upgraded my setup for better quality.
      Yes I would like to discuss more with you.please reach out on discord

  • @mouhamedbasse6311
    @mouhamedbasse6311 2 года назад +1

    Merci beaucoup pour le tuto Sensei! ça aurait été encore plus plus cool illustré avec un pageable.

  • @AnvarbekTurdaliyev
    @AnvarbekTurdaliyev Год назад

    thank you very much

  • @larsmichael6242
    @larsmichael6242 Год назад +2

    Nice video. Just having some trouble with querying nested objects in my entities. I'm using the @Embedded / @Embeddable annotations, but am not quite sure how to format the json data in my request body so that Spring understands.

    • @BoualiAli
      @BoualiAli  Год назад

      Can you share more details?
      Maybe in our discord server, sharing will be easier and get faster feedback

  • @samarthkamble7270
    @samarthkamble7270 Год назад

    Thanks a lot man❤

  • @imranmomin4571
    @imranmomin4571 10 месяцев назад

    @BoualiAli Can you make a video on search on multiple table using criteria query ?

  • @Utub-qc2cz
    @Utub-qc2cz 10 месяцев назад

    Question: Is there anyway to access Join tables using criteria API ?

  • @luwamabraham4338
    @luwamabraham4338 Год назад

    Thank You

  • @hoangkim6246
    @hoangkim6246 Год назад +1

    Thank you for your video. Can you tell me how to join multiple tables where the returned result list is a collection of attributes from those tables.I'm sorry that my English is very bad. I hope you will understand

  • @attabou100
    @attabou100 2 года назад

    Thanks a lot

  • @manojv2893
    @manojv2893 8 месяцев назад

    This syntax doesn't work with Hibernate 6 as we cannot use the same predicate more then once. Can you please re-record for Hibernate 6?

  • @daoookhanhuyenn
    @daoookhanhuyenn 6 месяцев назад

    If I want to join a table in Criteria, how should I do it?

  • @ankukoul07
    @ankukoul07 Год назад

    Nice..What if there are multiple filter conditions like for 20 fields..?

  • @norulshahlamjohn1140
    @norulshahlamjohn1140 Год назад

    i believe this all can be greatly simplified by using Derived Query Methods in Spring Data JPA Repositories right sir?

    • @BoualiAli
      @BoualiAli  Год назад

      It is possible but you will need to write a complex query for it to handle all the fields.
      Criteria query is more flexible in that direction

  • @ahmedabdoz
    @ahmedabdoz Год назад +1

    I am sorry but you said we are using that to avoid using if/else ,in the second example it ends up doing this , you have an if check for every search criteria

    • @BoualiAli
      @BoualiAli  Год назад

      there is a difference between if..else to compose a query and if..else for null check

  • @ngavv7095
    @ngavv7095 Год назад

    what spring-data-jpa-pro-class whait project in github want to do,it's about easier using JPA?Looking forward your answer,thacher

    • @BoualiAli
      @BoualiAli  Год назад

      This is the spring data jpa pro class course coming really soon.
      Join aliboucoding.com and you receive an email when the course is released

    • @ngavv7095
      @ngavv7095 Год назад

      @@BoualiAli tks

  • @GianfrancoTerrazzano
    @GianfrancoTerrazzano Год назад

    Hi! Thanks for the tutorial, it was great. There is a github where I can find the source code?

  • @mayureshkumar3717
    @mayureshkumar3717 5 месяцев назад

    didn't understood the last part of using toArray and passing it to the or method

  • @attabou100
    @attabou100 2 года назад

    In your opinion, is there an advantage of always using "Criteria Queries" despite it being too long and complicated ?

    • @BoualiAli
      @BoualiAli  2 года назад +1

      Always, I would say no
      I already explained the use case of criteria queries

  • @saiprasanthmattupalli4611
    @saiprasanthmattupalli4611 Год назад +1

    How do we join multiple tables in criteria query ?

    • @BoualiAli
      @BoualiAli  Год назад +1

      I will make a video on that soon

  • @gokulvarshan1114
    @gokulvarshan1114 Год назад

    can you help me with a problem please...
    i Need to filter a single string of a id from the list of string of id which is inthe database using this method you said can u tell me please

    • @BoualiAli
      @BoualiAli  Год назад

      Can you give an example?
      I didn’t get what you mean

    • @gokulvarshan1114
      @gokulvarshan1114 Год назад

      @@BoualiAli how to search a single string in list of string

  • @niladrisekharnath
    @niladrisekharnath Год назад

    I have a question why use Predicate[0] ?

    • @BoualiAli
      @BoualiAli  Год назад

      Foo[] array = list.toArray(new Foo[0]);

  • @mona9741
    @mona9741 8 месяцев назад

    do you have the code for this project in github, cause I can't find it
    ps: great vid

  • @rohan1618
    @rohan1618 Год назад

    Do you have junit for this code?

    • @BoualiAli
      @BoualiAli  Год назад

      Unfortunately not

    • @rohan1618
      @rohan1618 Год назад

      @@BoualiAli how to write junit for this any book anywhere

  • @elkhanismayilov
    @elkhanismayilov Год назад

    why yo doesn't suggest us dynamic query like any repo @Query ?

    • @BoualiAli
      @BoualiAli  Год назад +1

      Will add it in the next video

  • @muhendis_
    @muhendis_ Год назад

    there are lots of thing what ı dont know. I have to learn these descriptions 🙁

    • @BoualiAli
      @BoualiAli  Год назад

      Yes, the learning path is quite long but nothing is impossible

  • @piseyheng2564
    @piseyheng2564 Год назад

    Could you provide source code link please?

    • @BoualiAli
      @BoualiAli  Год назад

      I will try to find it and update the description

  • @stefumies
    @stefumies 2 месяца назад

    Quite a bit of information here, yet very disappointing that you are choosing to become far more involved than the last lessons. If you are choosing to show the more advanced areas of JPA I think more specific explanations are required. There is far too much for a beginner to consume, and you merely are instructing watchers to follow along with what you do, but failing to educate them on the what and why.
    For me, criteria queries are a rather less-than-basic-feature of JPA and, in this current example, highly unnecessary and over complicate things substantially. It almost feels as if you have skipped several more introductory lessons to JPA queries and started right in at the deep end.
    You do some great material, but many of your lessons are rather to off the flow for beginners. For me, I think most of your content is fantastic, even as an old and seasoned developer I always get something out of them,. but I feel here you have lost direction somewhat.

    • @BoualiAli
      @BoualiAli  2 месяца назад

      Hi,
      Thank you for the feedback.
      All the answers for your questions are in the spring data jpa complete lesson.
      It is better to enable the notifications to get all the recent videos.