5 ways to initialize lazy associations and when to use them HD
Lazy loading of associated entities is a well-established best practice in JPA. Its main goal is to retrieve only the requested entities from the database and to load the related entities only if needed. That is a great approach if you only need the entities you selected in your query. But it creates additional work and can be the cause of performance problems if you also need some of the associated entities. In this video, I show 5 different ways to trigger the initialization of lazy associations and their specific advantages and disadvantages. Links mentioned in the video: JPA 2.1 Entity Graph – Part 1: Named entity graphs: https://goo.gl/K6sFHv JPA 2.1 Entity Graph – Part 2: Define lazy/eager loading at runtime: https://goo.gl/sSFbke Join the free Thoughts on Java Library: https://goo.gl/OSG8rH Like my channel? Subscribe! ➜ http://bit.ly/2cUsid8 Want to connect with me? Blog: http://www.thoughts-on-java.org/ Twitter: https://twitter.com/thjanssen123 Facebook: https://www.facebook.com/thoughtsonjava
Похожие видео
Показать еще