title: Createcriteria in grails with count on hasMany relationship
body: <p>I have two classes</p>
  
  <pre><code>Quiz{
    String name
    static hasMany[tags:Tag]
  }
  
  Tag{
      String tag
  }
  </code></pre>
  
  <p>How can I write the following query in grails using criteria builder</p>
  
  <pre><code>select count(tag_id),tag  from quiz_tag 
  left outer join tag on tag_id=id
  group by tag_id,tag
  </code></pre>