title: Grails 1.3 criteria join or subquery on unassociated table
body: <p>I have a simple domain object</p>
  
  <pre><code>def MyDomain{
    String id
    String userId
    String blah
  
  }
  </code></pre>
  
  <p>and a user Id domain object</p>
  
  <pre><code>def User{
    String id //maps to user_id column, ommitted from example
    String firstName
    String lastName
  }
  </code></pre>
  
  <p>Within grails 1.3.7, is there a way to join the tables together using criteria?  We have many (80+) domain objects that use dynamically built criteria to do row lookups.  We recently have needed to add a User Name to each of these row lookups but would like to avoid going through and modifying that many domain objects if possible, especially since the data is small.  </p>
  
  <p>I have looked at DetachedCriteria, but this is only applicable for grails 2.0+ and upgrading is not an option just for this.  Other options I have seen involve putting User as a field in the MyDomain definition.  Is there a better way of doing this without all that overhead?  The corresponding query would be similar to:</p>
  
  <pre><code>select md.id, md.userId from myDomain md , user u where md.user_id = u.user_id order by     u.last_name, pu.first_name;
  </code></pre>