Spring Data JPA -Criteria Queries - The Full Guide

  Рет қаралды 48,710

Bouali Ali

Bouali Ali

Күн бұрын

Пікірлер: 98
@BoualiAli
@BoualiAli Жыл бұрын
Join the Micro Services course waiting list and get and get an exclusive *EARLY-BIRD discount* aliboucoding.ck.page/d0f9317e13
@supun_sandaruwan
@supun_sandaruwan Жыл бұрын
I didn't even heard about criteria queries in spring boot. Thank you so much for sharing knowledge with us, Sir ❤🌻.
@BoualiAli
@BoualiAli 9 ай бұрын
Glad you liked it!
@4wrk
@4wrk 9 ай бұрын
Thanks a lot! Your guide helped me to avoid creation of bunch of unnecessary methods within my repo layer :)
@BoualiAli
@BoualiAli 9 ай бұрын
Glad it helped!
@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 Жыл бұрын
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
@CoolBishop1997
@CoolBishop1997 3 ай бұрын
Jazaka llaho khayran
@fatemehsalem3850
@fatemehsalem3850 Жыл бұрын
Thank you for providing this tutorial, it is so unique
@BoualiAli
@BoualiAli Жыл бұрын
Happy you liked it!
@spring8355
@spring8355 2 жыл бұрын
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 2 жыл бұрын
You can check the exception handling video
@yashkevich
@yashkevich Жыл бұрын
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
@soumikdash2866
@soumikdash2866 6 ай бұрын
Thank you very much sir really appreciate your effort.
@toufiklaggoune5972
@toufiklaggoune5972 2 жыл бұрын
Always the best. Keep going bro.
@BoualiAli
@BoualiAli 2 жыл бұрын
Thanks a lot. I will
@pqan112
@pqan112 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
@atefjlassi193
@atefjlassi193 2 жыл бұрын
Great, Thank you Bouali
@BoualiAli
@BoualiAli 2 жыл бұрын
Thank you
@rihabbensoula1016
@rihabbensoula1016 2 жыл бұрын
Great job ,keep going
@BoualiAli
@BoualiAli 2 жыл бұрын
Thank youuuuu
@123cheke
@123cheke 2 ай бұрын
great video. Quick question, what about if email has underscore characters(_) ?
@Teze-m8b
@Teze-m8b 7 ай бұрын
Excellent tutorial
@geethikathota9063
@geethikathota9063 Жыл бұрын
Very helpful. Thank you so much.
@BoualiAli
@BoualiAli Жыл бұрын
Glad it was helpful!
@kyrylochornobryvets3385
@kyrylochornobryvets3385 6 ай бұрын
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. 👍
@ShrivastavaMohit07
@ShrivastavaMohit07 Жыл бұрын
Great explanation
@BoualiAli
@BoualiAli Жыл бұрын
Glad it was helpful!
@ruff7209
@ruff7209 Жыл бұрын
Nice tutorial, thx man!
@BoualiAli
@BoualiAli Жыл бұрын
Happy you enjoyed it
@attabou100
@attabou100 2 жыл бұрын
Exactly ; I repeated the video , and you explained very well when criteria is used ; thnaks a lot dear Teacher
@BoualiAli
@BoualiAli 2 жыл бұрын
My pleasure 😇
@samarthkamble7270
@samarthkamble7270 Жыл бұрын
Thanks a lot man❤
@BoualiAli
@BoualiAli Жыл бұрын
You're welcome!
@elkhanismayilov
@elkhanismayilov 6 ай бұрын
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???
@AnvarbekTurdaliyev
@AnvarbekTurdaliyev Жыл бұрын
thank you very much
@BoualiAli
@BoualiAli Жыл бұрын
My pleasure!
@imranmomin4571
@imranmomin4571 Жыл бұрын
@BoualiAli Can you make a video on search on multiple table using criteria query ?
@nailiridha7179
@nailiridha7179 2 жыл бұрын
tres bien bravo
@BoualiAli
@BoualiAli 2 жыл бұрын
Thank you
@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
@hoangkim6246
@hoangkim6246 Жыл бұрын
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
@BoualiAli
@BoualiAli Жыл бұрын
User Projection
@larsmichael6242
@larsmichael6242 Жыл бұрын
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
@ankukoul07
@ankukoul07 Жыл бұрын
Nice..What if there are multiple filter conditions like for 20 fields..?
@BoualiAli
@BoualiAli Жыл бұрын
Same way
@attabou100
@attabou100 2 жыл бұрын
Thanks a lot
@BoualiAli
@BoualiAli 2 жыл бұрын
Welcome
@luwamabraham4338
@luwamabraham4338 2 жыл бұрын
Thank You
@BoualiAli
@BoualiAli 2 жыл бұрын
My pleasure
@codewithtee
@codewithtee 2 ай бұрын
How can make the list be a custom Response, e.g EmplyeeResponseDto and also how do I query relation of Employee (e.g depeartment)
@Utub-qc2cz
@Utub-qc2cz Жыл бұрын
Question: Is there anyway to access Join tables using criteria API ?
@daoookhanhuyenn
@daoookhanhuyenn 8 ай бұрын
If I want to join a table in Criteria, how should I do it?
@smb6311
@smb6311 2 жыл бұрын
Merci beaucoup pour le tuto Sensei! ça aurait été encore plus plus cool illustré avec un pageable.
@BoualiAli
@BoualiAli 2 жыл бұрын
Noted
@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
@GianfrancoTerrazzano
@GianfrancoTerrazzano Жыл бұрын
Hi! Thanks for the tutorial, it was great. There is a github where I can find the source code?
@BoualiAli
@BoualiAli Жыл бұрын
In the description
@manojv2893
@manojv2893 10 ай бұрын
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?
@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
@ahmedabdoz
@ahmedabdoz Жыл бұрын
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
@saiprasanthmattupalli4611
@saiprasanthmattupalli4611 2 жыл бұрын
How do we join multiple tables in criteria query ?
@BoualiAli
@BoualiAli 2 жыл бұрын
I will make a video on that soon
@mayureshkumar3717
@mayureshkumar3717 7 ай бұрын
didn't understood the last part of using toArray and passing it to the or method
@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
@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 жыл бұрын
Always, I would say no I already explained the use case of criteria queries
@mona9741
@mona9741 10 ай бұрын
do you have the code for this project in github, cause I can't find it ps: great vid
@BoualiAli
@BoualiAli 9 ай бұрын
Sorry, no
@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
@niladrisekharnath
@niladrisekharnath Жыл бұрын
I have a question why use Predicate[0] ?
@BoualiAli
@BoualiAli Жыл бұрын
Foo[] array = list.toArray(new Foo[0]);
@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
@elkhanismayilov
@elkhanismayilov Жыл бұрын
why yo doesn't suggest us dynamic query like any repo @Query ?
@BoualiAli
@BoualiAli Жыл бұрын
Will add it in the next video
@piseyheng2564
@piseyheng2564 Жыл бұрын
Could you provide source code link please?
@BoualiAli
@BoualiAli Жыл бұрын
I will try to find it and update the description
@stefumies
@stefumies 4 ай бұрын
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 4 ай бұрын
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.
Database migration using Flyway + Spring boot + Hibernate + SQL
25:39
REAL or FAKE? #beatbox #tiktok
01:03
BeatboxJCOP
Рет қаралды 18 МЛН
BAYGUYSTAN | 1 СЕРИЯ | bayGUYS
36:55
bayGUYS
Рет қаралды 1,9 МЛН
JPA/Hibernate Fundamentals 2023 - Lesson 13 - Criteria query
51:45
Reactive Programming with Spring Boot | A Beginner's Guide
40:31
[Episode 55] Spring Data JPA Specifications
48:33
Bingyang Wei
Рет қаралды 2,9 М.
JAVA DTO Pattern Tutorial | Simplify Your Code
19:12
Amigoscode
Рет қаралды 222 М.
All Rust string types explained
22:13
Let's Get Rusty
Рет қаралды 199 М.