title: Using outer joins in HQL queries
body: <p>I'm trying to build a query using HQL and <code>OUTER JOIN</code>s and just can't get it work. Consider the following mapping</p>
  
  <pre><code>&lt;class name="Parent"&gt;
      &lt;id name="id" type="integer"&gt;
        &lt;generator class="native" /&gt;
      &lt;/id&gt; 
  &lt;/class&gt;
  
  &lt;class name="Child"&gt;
      &lt;id name="id" type="integer"&gt;
        &lt;generator class="native" /&gt;
      &lt;/id&gt; 
      &lt;many-to-one name="parent"/&gt;
  &lt;/class&gt;
  </code></pre>
  
  <p>Now I"d like to get a list of all Parents and the amount of the Parents' children. Suppose I have one Parent with two children and one Parent with no children at all. I'd expect an output like</p>
  
  <pre><code>+-------------------+
  | parent | children |
  +--------+----------+
  |  1     | 2        |
  |  2     | 0        |
  +--------+----------+
  </code></pre>
  
  <p>using plain SQL it isn't a problem at all, I'll get this output doing something like</p>
  
  <pre><code>SELECT p.id as parent, count(c.id) as children from parents p LEFT OUTER JOIN children c on c.parent_id = p.id group by p.id;
  </code></pre>
  
  <p>However it doesn't seem to be possible using HQL as one needs a <strong>path</strong> from Parent to Child when using a <code>OUTER JOIN</code>, which I obviously don't have (and also don't want to add).</p>
  
  <p>Any ideas how to get the query working using HQL or is it really - I couldn't believe it - a missing hibernate feature?</p>