Codetown ::: a software developer's community
JPA 2.1 Entity Graphs
Spring Data JPA makes querying easy, but the typical use case is to use lazy loading on child records, which can result in performance issues, such as the dreaded "N+1 selects" problem. JPA 2.1 introduced Entity Graphs, allowing you to explicilty state which entities get loaded at runtime, resulting in highly performant query joins. We’ll take a look at how to implement Entity Graphs in the context of a Spring Boot application.
Let me know if you’ll help out by sponsoring pizza. Thanks, Mike Levin