title: Sort Objects Of Class Which Has hasMany relationship
body: <p>I have Domains like this</p>
  
  <pre><code>class A{
  
  String mainAddress
  static hasMany = [Bs: B]
  static mapping = {
   mainAddress formula: ('select ad.zip from B  ad where ad.a_id=id')
   }
  }
  
  Class B{
  String zip
  static belongsTo = [a: A]
  }
  
  let A1 -&gt;B1
         -&gt;B2
  and A2 -&gt;B3
         -&gt;B4
      A3 -&gt;B5
         -&gt;B6
         etc..
  </code></pre>
  
  <p>Now I want to sort on the basis of zip Of B1, B3,B5 etc</p>
  
  <p><strong>Edit</strong>: I did some changes in question and then I try to access</p>
  
  <pre><code>  a.mainAddress 
  </code></pre>
  
  <p>this gives null</p>