title: retrieve data and return it in a tree structure
body: <p>I have some code here in coldfusion that retrieves my organisation's structure using a basic for loop</p>
  
  <p><strong>example:</strong></p>
  
  <pre><code>level1 = retrieveOrgs(1);
  for loop level1
      &lt;span&gt;level1.description&lt;/span&gt;
      level2 = retrieveOrgs(level1.orgId);
      for loop level2
          &lt;span&gt;level2.description&lt;/span&gt;
          level3 = retrieveOrgs(level1.orgId);
          for loop level3
              ....
          end;
      end;
  end;
  </code></pre>
  
  <p>I am moving the webapp to java using spring/hibernate combo. And I'm wondering if there is a "better" way of doing this in Java/Spring/Hibernate.</p>
  
  <p>Thanks</p>