JPA & Hibernate: Using the Optimal Query Approach & Projection

Using JPA and Hibernate, you can choose between various ways to query your data, and each of them supports one or more kinds of projections. That provides you with lots of options to implement your persistence layer. But which one fits your use case? And which one should you avoid if you want to optimize your persistence layer for performance?
To answer these questions, we need to talk about the different ways to define a query. One of them is JPQL, of course. It’s a query language based on your domain model. But you can also use multiple proprietary and standardized APIs to create a query. Or you can execute native SQL queries if you need to use database-specific query features or define very complex queries.
In this video, I will explain when you should use which approach to using optimal query approach and projection.
If you are new here and you want to learn how to create your entity mappings with ease, build incredible efficient persistence layers with Hibernate and all types of other Java persistence related stuff, start now by subscribing and clicking the bell, so you don’t miss anything.
And if you have any topic or question related to Hibernate that you want to learn more about, please share it in the comment section below

If you like this video, please give me your thumbs up and share it with your friends and co-workers.
Links mentioned in the video-
• Basic SQL ResultSet Mappings :
• Complex SQL ResultSet Mappings :
• Mapping DTO Projections :
• Hibernate-specific Mappings :
• How to select multiple scalar values in a Criteria Query :
• Entities or DTOs – When should you use which projection? :
• Native Queries – How to call native SQL queries with JPA & Hibernate :

 Like my channel? Subscribe!

Join the free Member Library:

Read the accompanying post:

Want to connect with me?

#hibernate #JPA #Projection #OptimalQueryApproach

Youtube original link

Leave a Reply

Your email address will not be published. Required fields are marked *