title: How to count rows calculated by GROUP BY using Criteria Api
body: <p>I want to do this by using criteria API:</p>
  
  <pre><code>select count(subQ.*)
  from (  
      select *
      from items
      group by type
  ) subQ
  </code></pre>
  
  <p>I need to count types, not elements in each type.
  Is it possible ?</p>