title: How can I add a criteria to a grails criteria to limit results based on a filtered association?
body: <p>In my old java code I could do this to "join" another table in a hibernate query and filter results based on it.</p>
  
  <pre><code> final Criteria brokerageCriteria = userCriteria.createCriteria("brokerage");
              if (queryDto.getBrokerageID() != null) {
                  brokerageCriteria.add(Restrictions.eq("id", queryDto.getBrokerageID()));
              }
  </code></pre>
  
  <p>In this example it would filter users who are a member of a specific brokerage only (each user has one brokerage).</p>
  
  <p>As you can see I can easily join other tables that are associated in the hibernate mappings by calling criteria.createCriteria(String associationName).  Is there anything similar to this in grails?  I am trying to build a general purpose JSON-to-criteria web api for our internal developers to search various tables, page through data, etc.</p>