Lazy fetching is only the 1st step to avoid Hibernate's most common performance problems. You also have to tell Hibernate which relationships it shall initialize when fetching your entity.
And that’s easier than it might sound.
Adding a JOIN FETCH clause is only a small change to your query that can solve your n+1 select issues if you use it correctly.
--------------------------------------------------------------------------------------
Learn everything you need to build fast and maintainable persistence layers! 👉🏻 https://thorben-janssen.com/join-pers...
--------------------------------------------------------------------------------------
I'm a freelance consultant and trainer helping Java developers create better persistence layers using Hibernate and Spring Data.
Get the best videos to grow your persistence skills and become your team's expert. Subscribe to not miss any videos.