title: Grails,Gorm, using createCriteria or some other alternative
body: <p>For example, I've parent class Author:</p>
  
  <pre><code>class Author {    
      String name
      static hasMany = [
           fiction: Book, 
           nonFiction: Book
      ]
  }
  </code></pre>
  
  <p>and a child class Book:</p>
  
  <pre><code>class Book {    
      String title
      static belongsTo = [author: Author]
  }
  </code></pre>
  
  <p>I've done some records to Author using:</p>
  
  <pre><code>def fictBook = new Book(title: "IT")
  def nonFictBook = new Book(title: "On Writing: A Memoir of the Craft")
  def a = new Author(name: "Stephen King")
               .addToFiction(fictBook)
               .addToNonFiction(nonFictBook)
               .save()
  </code></pre>
  
  <p>How can I found child-class record by parent and parent-class record by child?</p>
  
  <p>I tried to use findBy method, as below:</p>
  
  <pre><code>def book = Book.get(1)
  def author = Author.findByFiction(book)
  </code></pre>
  
  <p>But I get an error:</p>
  
  <pre><code>Parameter "#2" is not set; SQL statement:
  </code></pre>
  
  <p>I read, what in some relationship findBy is denied for using, how I can rewrite it using criteria or some others methods?</p>