title: Tree structure in GORM (grails)
body: <p>I'm trying to define a tree structure in GORM. Here is my model:</p>
  
  <pre><code>class Tree {
      String name
      Level rootLevel
  
      static hasOne = [rootLevel: Level]
      static hasMany = [levels: Level]
      static mappedBy = [levels:"parentTree"]
  }
  
  class Level {
      String name
      Tree parentTree
      Level parentLevel
      Set&lt;Level&gt; subLevels
  
      static belongsTo = [parentTree: Tree]
      static hasMany = [subLevels: Level]
  }
  </code></pre>
  
  <p>Insertion seems to work fine, but when I can't load a Tree with many levels and sublevels.
  I guess I missed something in the relations:
  - the Tree should have a reference to the rootLevel (and optionally to all sublevels)
  - a Level should have a reference to its parent level, its sublevels and the global parent Tree</p>
  
  <p>Could you point me out the right direction to get a tree structure like this ?
  Thanks</p>