title: How do I map a resultset to a nested structure of objects?
body: <p>I have a result set like this… </p>
  
  <pre><code>+--------------+--------------+----------+--------+
  | LocationCode | MaterialCode | ItemCode | Vendor |
  +--------------+--------------+----------+--------+
  |            1 |           11 |      111 |   1111 |
  |            1 |           11 |      111 |   1112 |
  |            1 |           11 |      112 |   1121 |
  |            1 |           12 |      121 |   1211 |
  +--------------+--------------+----------+--------+
  </code></pre>
  
  <p>And so on for LocationCode 2,3,4 etc. I need an object (to be converted to json, eventually) as : <code>List&lt;Location&gt;</code>
  Where the the hierarchy of nested objects in Location Class are..</p>
  
  <pre><code>Location.class
      LocationCode
      List&lt;Material&gt;
  
  Material.class
      MaterialCode
      List&lt;Item&gt;
  
  Item.class
      ItemCode
      Vendor
  </code></pre>
  
  <p>This corresponds to the resultset, where 1 location has 2 materials, 1 material(11) has 2 Items, 1 item(111) has 2 vendors. </p> How do i achieve this? I have used <code>AliasToBeanResultTransformer</code> before, but i doubt it will be of help in this case.</p>