title: Hibernate recursive fetch join not recursively fetching all children
body: <p>I have a directory type structure represented as entities, i.e. think Directory entity and File entity.</p>
  
  <p>The Directory entity has a collection of File entities and a collection of Directory entities.</p>
  
  <p>I want to get the root directory and 'pre load' all directories and there files.</p>
  
  <p>I am trying:</p>
  
  <pre><code>String queryString = "SELECT DISTINCT d FROM " + 
     Directory.class.getSimpleName() + 
     " d LEFT JOIN FETCH d.files LEFT JOIN FETCH d.directories child LEFT JOIN FETCH child.files LEFT JOIN FETCH child.directories WHERE f.root = :isRoot);
  Query query = em.createQuery(queryString);
  query.setParameter("isRoot", true);
  
  Directory dir = (Directory) query.getSingleResult();
  </code></pre>
  
  <p>The query works it just does not pre load everything.  I get all of the root directories and the root files, but when I start going into the sub directories and get the files queries are made.  I.E. it seems like the recursion is not working.</p>
  
  <p>I have also tried just a JOIN FETCH (which I think does an inner join fetch) with no luck.</p>
  
  <p>Any ideas?</p>