title: Grails - Use logical OR in CreateCriteria
body: <p>Starting with the following Domains:</p>
  
  <pre><code>class Person {
      String login
      String name 
  }
  
  class MyDomain {
      Person creator
      static hasMany =  [userlist:Person]
  }
  </code></pre>
  
  <p>I wrote a critera to retreive all MyDomainIntances where I'm as creator OR where I'm in the userlist:</p>
  
  <pre><code>def login = "myself"
  
  def result =  MyDomain.createCriteria().list () {
      projections { distinct ( "id" )
          property("name")
          property("id")
      }
      or {             
         userlist{eq("login", login)}
         creator {eq("login",login)}
      }
  
      order("name","desc")
  }
  </code></pre>
  
  <p>The problem is with this code I get only instances where I'm in the userlist.</p>
  
  <p>Though <code>creator {eq("login",login)}</code> works well: if I use it itself only, I get a list where I'm as creator </p>
  
  <hr>
  
  <p><strong>generated query:</strong></p>
  
  <pre><code>Hibernate:
  select distinct this_.id as y0_,this_.name as y1_,this_.id as y2_
  from mydomain this_ inner join person creator_al2_ on this_.creator_id=creator_al2_.id
                      inner join mydomain_person userlist5_ on this_.id=userlist5_.mydomain_userlist_id
                      inner join person userlist1_ on userlist5_.person_id=userlist1_.id
  where ((userlist1_.login=?) or (creator_al2_.login=?))
  order by this_.name desc 
  </code></pre>