title: Grails GORM Domain class relationship
body: <p>Grails 1.1.1
  Goovy 1.5.7</p>
  
  <p>In a relationship such this:</p>
  
  <p>Author 1 -- n Book n -- 1 Publisher</p>
  
  <p>Defined in Grails:</p>
  
  <pre><code>class Author {        
    String firstName
    String lastName
  
    static hasMany = [books: Book]       
  
    static constraints = {
        books(nullable: true)
    }
  }
  
  class Book {        
    String title
    Author author
    Publisher publisher
  
    static constraints = {
      author(nullable: true)
      publisher(nullable: true)
    }
  }
  
  class Publisher {
  
    String name
  
    static hasMany = [books: Book]
  
    static constraints = {
        books(nullable: true)
    }
  }
  </code></pre>
  
  <p>I want to load a Book with the values of Publisher and Author.
  When i get a Book with the query:</p>
  
  <pre><code>def book2 = Book.findAllByAuthor(author)
  </code></pre>
  
  <p>I get the response with the autor assosiated but the publisher only have the id and name class in the other query:</p>
  
  <pre><code>def book3 = Book.findAllByPublisher(publisher)
  </code></pre>
  
  <p>I retrieve me the inverse result,i have the book with the publisher data but the author only have the id and the class name.</p>
  
  <p>Where is the error in the defined model ? o there is an error in the way to do the queries ?</p>
  
  <p>Edit: </p>
  
  <p>I need the way to retrieve the values only with the query like this:</p>
  
  <pre><code>def book2 = Book.findAllByAuthor(author, [fetch:[publisher:'eager']])
  </code></pre>
  
  <p>In this one I can manage the value of publisher.</p>
  
  <p>Question: If publisher had a <code>hasmany</code> or <code>Domain</code> related, getting the book I'm able to read the attributes?</p>
  
  <p>Thanks.
  Thanks.</p>