title: Limit items in collection with HQL
body: <p>In my model I have two entities: Person and Puppy (to simplify it :) ). There is One To Many relationship between them so each Person has collection of puppies.</p>
  
  <p>Now want to write HQL query which will list all persons with name "John" but also limit puppies to those older than 2 months.</p>
  
  <p>my first try looked like this:</p>
  
  <pre><code>SELECT p FROM Person p
  JOIN FETCH p.puppies pu
  WHERE p.name = 'John'
  AND pu.age &gt; 2
  </code></pre>
  
  <p>But it doesn't work because this query selects ONLY those persons who have AT LEAST one puppy older than two months but not those who have only younger. And I also want to see them just with empty puppy list.</p>
  
  <p>Effectively I would like to achieve something like (pseudo code):</p>
  
  <pre><code>SELECT p FROM Person p
  JOIN FETCH p.puppies pu HAVING (pu.age &gt; 2 )
  WHERE p.name = 'John'
  </code></pre>