title: hibernate inner select in from clause
body: <p>I'd like to know if it's possible to specify a select clause in a from clause something like </p>
  
  <pre><code>select count(*) as Y, this_.NAME as A, sel2.C
  from TABLE1 this_, 
      (select count(*) as C from 
          (select this_.NAME, this_.SEX 
          from TABLE1 this_ group by this_.NAME, this_.SEX) sel1
      ) sel2
  group by this_.NAME, sel2.C;
  </code></pre>
  
  <p>I need a query like this in order to have the count number as an extra column in the outer query.
  I can't find out how to specify a select statement in a from, neither with hql nor with criteria.</p>
  
  <p>Thank you.</p>
  
  <p>Luca</p>