title: hql - how to populate a child entity's lazy collection when fetching the parent
body: <p>suppose i have @Entity A, which has an eager @ManyToOne to @Entity B, and this B has a lazy (default) @OneToMany to a collection called "images"</p>
  
  <p>i want to do something like:</p>
  
  <pre><code>"select a from A a join fetch a.b.images where a.b = :b"
  </code></pre>
  
  <p>this is a query that finds an instance of A given an instance of B (the A-->B link is unidirectional from A).
  trying something like the above approach lands me a hibernate exception:</p>
  
  <pre><code>query specified join fetching, but the owner of the fetched association was not present in the select list
  </code></pre>
  
  <p>but trying something like</p>
  
  <pre><code>"select a, a.b.images from ..."
  </code></pre>
  
  <p>will return multiple results for every instance of A (multiplied by the amount of images)</p>
  
  <p>how do i write a query on A that populates a.b.images ?</p>