An Introduction to JPA FetchTypes

preview_player
Показать описание
The JPA FetchType defines when Hibernate gets the related entities from the database, and it is one of the crucial elements for a fast persistence tier. In general, you want to fetch the entities you use in your business tier as efficiently as possible. But that’s not that easy. You either get all relationships with one query or you fetch only the root entity and initialize the relationships as soon as you need them.

I’ll explain both approaches in more detail in this video and also provide you some links to more advanced solutions that combine flexibility and efficiency.

If you like this video, please give me your thumbs up and share it with your friends and co-workers.

Like my channel? Subscribe!

Join the free Member Library:

Resources mentioned in the video:

Want to connect with me?
#JPA #FetchTypes #Hibernate #LazyLoading
Рекомендации по теме
Комментарии
Автор

Done thanks
Default fetch type:
Lazy for a tomany relationship
Eager for a toone relationship

Jpql query with join fetch entity.relatedEntity to force hibernate to fetch a lazy relationship with one query (doing a join) instead of doing a separate select when we access entity.relatedEntity

mostinho
visit shbcf.ru