The article explains the concept of FetchType in Hibernate and JPA, discussing the differences between FetchType.EAGER and FetchType.LAZY. It also covers how to change the default FetchType and addresses the issue of n+1 selects in Hibernate.
Table of contents
Default FetchTypes and how to change itFetchType.EAGER – Fetch it so you’ll have it when you need itFetchType.LAZY – Fetch it when you need itSummarySort: