A common criticism of JPA is that it generates inefficient SQL, often resulting in several queries where one would do. In particular, it’s prone to the n+1 problem where it loads an entity with one query and then runs an additional query for each item in an owned collection. JPA Entity Graph is one way to avoid this. It allows the application developer to closely control how related entities are fetched. You can use JPA Entity Graph to tell JPA to load a complex web of entities with a single query and significantly improve performance of your application.
Stuart 'Stevie' Leitch on Software Development, Java Technologies, Security and Testing