title: Is there any way in Grails to eager fetch the whole record?
body: <p>I am trying to find if there is any way in Grails to eager fetch complete records instead of a left Join. </p>
  
  <p>I have two classes with one to many mapping. When I try to get all the records and render as XML, only the IDs of the "many" side get into the XML file. Is there anyway to get the whole records?</p>
  
  <p>The example that I am using is as following:</p>
  
  <p>I have 3 classes:</p>
  
  <p>User, Book and Chapter</p>
  
  <p>Users and Book have a many to many mapping and Book to Chapters is a one to many mapping. I have a class UserBook which defines the many to many relationship. Now I have the following code</p>
  
  <pre><code>user = User.findByUserId(params.userid.toString())
          def books = user.getAllBooks()
          render books as XML
  
  Set&lt;Book&gt;getAllBooks() {
          UserBook.findAllByUser(this).collect {it.book} as Set
      }
  </code></pre>
  
  <p>The above renders an XML with the books and also the chapter IDs for each book. What I wanted was the "books" above to contain all the chapter information as well.</p>
  
  <p>Thanks!!</p>