title: Question of grails findAllBy when search for for foreign key
body: <pre><code>class File {
     String name
     File parent;    
     static belongsTo =[parent:File ]   
     static hasMany = [childrens:File];   
     static mapping = {   
        table 'Info_File'
        id(generator:'sequence', params: [sequence: 'seq_file'])
        parent:[lazy:"true",cascade:"none"]   
        children joinTable:[name:'children', key:'parent_Id', column:'Id',lazy:"true",inverse:"false",cascade:"none"]   
      }   
      static constraints = {   
          parent(nullable:true)   
      }   
  }
  </code></pre>
  
  <p>now i want to get all the file which parent id = 1
  how can i do it?</p>
  
  <p>i try to use </p>
  
  <pre><code>def fileList = File.findAllByParent(File.get(1L))
  </code></pre>
  
  <p>but it will send 2 sql, the 1st is to get the parent file info which i dont want it.</p>
  
  <p>is there any method such as File.findAllByParentId(1L)</p>
  
  <p>3x</p>
  
  <hr>
  
  <p>thanks.</p>
  
  <pre><code>parent{eq('key', 1)} 
  //sql:from Info_File this_ left outer join Info_File parent_ali1_ 
  //on this_.parent_id=parent_ali1_.id where (parent_ali1_.id=?)
  </code></pre>
  
  <p>but i dont need to join table.
  so i try </p>
  
  <pre><code>eq('parent.id',1L)
  //it's what i need:
  //from Info_File this_ where this_.parent_id=?
  </code></pre>