5 Tips To Write Efficient Queries With JPA And Hibernate

  Рет қаралды 10,213

Thorben Janssen

Thorben Janssen

Күн бұрын

A lot of developers seem to have a love-hate relationship with JPA and Hibernate. They love it because it makes it easy to implement most use cases and they hate it because it also makes it easy to implement very inefficient queries.
In the past, I was one of these developers myself. I liked to use Hibernate, but I also struggled with slow database queries and other performance issues. That changed over the years when I spend more and more time working with and teaching about Hibernate.
When you analyze enough inefficient queries, you recognize that you just have to follow a few simple recommendations to avoid most of them.
If you like this video, please give me your thumbs up and share it with your friends and co-workers.
Like my channel? Subscribe!
➜ bit.ly/2cUsid8
Join the free Member Library:
goo.gl/dtyIIC
Read the accompanying post: www.thoughts-o...
Want to connect with me?
Blog: www.thoughts-on...
Twitter: / thjanssen123
Facebook: / thoughtsonjava
#JPA #Hibernate #queries #performance tuning

Пікірлер: 5
@santoshsharma3208
@santoshsharma3208 4 жыл бұрын
Hi! your tutorials are great for beginners like me. Could you please explain the recursive json problem in many-to-many mapping, as well as complex filter queries in jpa hibernate that take on dynamic list as a parameter.
@7BlackJack8
@7BlackJack8 7 жыл бұрын
I think lots of people would be grateful to you, if u could extend the Entity Graph and Join Fetch with Criteria part of this video. Maybe with some use cases as usual. Pls do a dedicated video..This could help expecially because of the new 2.1 specs around.
@Thorben-Janssen
@Thorben-Janssen 7 жыл бұрын
Hi, Thanks for your comment. I explain EntityGraph and @NamedEntityGraph in more details in this video: kzbin.info/www/bejne/eqOYgqFsg6hgabs And I wrote about it in these posts: www.thoughts-on-java.org/2014/03/jpa-21-entity-graph-part-1-named-entity.html www.thoughts-on-java.org/2014/04/jpa-21-entity-graph-part-2-define.html Regards, Thorben
@stuartbrock7586
@stuartbrock7586 Жыл бұрын
Hibernate is not properly populating the primary keys which are sequence generated if fetch type Eager isn't used. I am guessing the work around on this is to create the child entities first and then populate the relationships. There seems to be a lot of work arounds in hibernate. There is a ton of does and don'ts when working with hibernate, hell Thorben, you've made a living out of documenting them and giving classes on them. Why not just learn and use SQL and use JDBC to get all the data that is needed for each of the queries? That is my recommendation for the future.
@mikhailwiseman5296
@mikhailwiseman5296 2 жыл бұрын
thanks
Spring Data JPA -Criteria Queries - The Full Guide
30:07
Bouali Ali
Рет қаралды 43 М.
Help Me Celebrate! 😍🙏
00:35
Alan Chikin Chow
Рет қаралды 89 МЛН
1 сквиш тебе или 2 другому? 😌 #шортс #виола
00:36
MY HEIGHT vs MrBEAST CREW 🙈📏
00:22
Celine Dept
Рет қаралды 79 МЛН
Skyrocket Your API Performance with These Techniques
8:06
Daily Code Buffer
Рет қаралды 14 М.
How to call native SQL queries with JPA and Hibernate
13:46
Thorben Janssen
Рет қаралды 4,5 М.
JPA & Hibernate: Using the Optimal Query Approach & Projection
11:13
Thorben Janssen
Рет қаралды 4,6 М.
Hibernate & JPA Tutorial - Crash Course
24:27
Marco Codes
Рет қаралды 106 М.
5 Hibernate 5 features every developer should know
12:54
Thorben Janssen
Рет қаралды 31 М.
5 Ways to Improve Your SQL Queries
10:04
Kahan Data Solutions
Рет қаралды 93 М.
Spring Data JPA   Implementing Bulk Updates
8:57
Thorben Janssen
Рет қаралды 10 М.
Help Me Celebrate! 😍🙏
00:35
Alan Chikin Chow
Рет қаралды 89 МЛН