5 Tips To Write Efficient Queries With JPA And Hibernate

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

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
5 ways to initialize lazy associations and when to use them
11:16
Thorben Janssen
Рет қаралды 16 М.
How to call native SQL queries with JPA and Hibernate
13:46
Thorben Janssen
Рет қаралды 4,7 М.
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 30 МЛН
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 20 МЛН
BAYGUYSTAN | 1 СЕРИЯ | bayGUYS
36:55
bayGUYS
Рет қаралды 1,9 МЛН
7 Tips to improve your Hibernate performance
23:44
Thorben Janssen
Рет қаралды 31 М.
Hibernate: 6 Mappings to Avoid for High-Performance Applications
10:11
Thorben Janssen
Рет қаралды 10 М.
JPA & Hibernate: Using the Optimal Query Approach & Projection
11:13
Thorben Janssen
Рет қаралды 4,6 М.
API Design: Don’t expose your JPA entities in your REST API
10:24
Thorben Janssen
Рет қаралды 21 М.
Best Practices for Many-To-One and One-To-Many Association Mappings
9:35
Spring Data JPA: Ultimate Guide to Custom Queries with @Query Annotation
15:09
How to call native SQL queries with JPA and Hibernate
13:32
Thorben Janssen
Рет қаралды 36 М.
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 30 МЛН