title: Grails createCriteria: finding objects via a field that is a null domain class instance
body: <p>I'm seeing some unexpected behavior in Grails' createCriteria.  I have a domain class that looks like this:</p>
  
  <pre><code>MyDomainClass {
      AnotherDomainClass anotherDomainClass
      static constraints = {
          anotherDomainClass(nullable:true)
      }
  }
  </code></pre>
  
  <p>I want to find all instances of MyDomainClass where anotherDomainClass is null.  So I do this:</p>
  
  <pre><code>return MyDomainClass.createCriteria().list {
      eq('anotherDomainClass', null)
  }
  </code></pre>
  
  <p>However, I get nothing back.</p>
  
  <p>What am I doing wrong?  I can see there are database entries where the ANOTHERDOMAINCLASS_ID column is indeed null (or blank, I can't tell).   </p>
  
  <p>I'd be fine creating a query that references the ANOTHERDOMAINCLASS_ID column directly, but I haven't found a way yet.</p>
  
  <p>Thanks!</p>