title: jpql "join fetch" vs EntityGraph
body: <p>I want to load related entities by using either jpql or jpa entity graph. </p>
  
  <p>It seems both do the same thing. </p>
  
  <p>Why should I use <strong>Entity Graphs</strong> instead of plain <strong>jpql</strong>? Are there any benefits?</p>
  
  <p>What is the difference of using jpql:</p>
  
  <pre><code>select distinct u from User u join fetch u.hobbies a join fetch a.tasks
  </code></pre>
  
  <p>or Entity Graph:</p>
  
  <pre><code>@NamedEntityGraph(name = "User.eagerfetch", attributeNodes = { 
          @NamedAttributeNode("hobbies"),
          @NamedAttributeNode("tasks")})
  </code></pre>