title: Mapping a nested Oracle CURSOR (ResultSet) with myBatis
body: <p>Is it possible to map a nested <code>java.sql.ResultSet</code> in a myBatis <code>resultMap</code>?</p>
  
  <p>For example. Say that I have a procedure mapping defined like so:</p>
  
  <pre><code> &lt;select id="selectBlog" statementType="CALLABLE"&gt;
          {call getCarsByYear(
             #{year,jdbcType=INTEGER,mode=IN},
             #{results, jdbcType=CURSOR, mode=OUT, javaType=java.sql.ResultSet, jdbcType=CURSOR, resultMap=cars}
          )}
      &lt;/select&gt;
  </code></pre>
  
  <p>And my mapper. which returns a list of car objects, but also a list of dealerships (the nested CURSOR):</p>
  
  <pre><code>&lt;resultMap id="cars" type="some.package.Car"&gt;
     &lt;result property="name" column="car_name"&gt;
     &lt;!-- here is my problem --&gt;
     &lt;collection property="dealerships" column="dealerships_rf" ofType="some.package.Dealership"&gt;
         &lt;result property="model" column="model" /&gt;
         &lt;result property="year" column="year" /&gt;
  &lt;/resultMap&gt;
  
  &lt;!-- dealership resultMap of type some.package.Dealership --&gt;
  </code></pre>
  
  <p>Problem here is, when I inspect the resulting  java object <code>dealerships</code> is an empty List. </p>
  
  <p>I wrote some plain old java.sql JDBC code and it worked fine. Cany anyone put me on the right path? I am completely lost with this one.</p>
  
  <p>Thanks in advance.</p>
  
  <p>Here is the expected SQL output:</p>
  
  <pre><code>Car
  |name  |dealerships|
  |nissan|ref_cursor|
  
  Dealership
  |location     |established|....
  |....         |1974       |...
  </code></pre>
  
  <p>Cars model:</p>
  
  <pre><code>public class Car {
  
   private String name;
   private List&lt;Dealership&gt; dealerships;
  
   // getters &amp; setters ...
  
  }
  
  public class Dealership {
  
    private String model;
    private Integer year;
  
    // getters &amp; setters ...
  }
  </code></pre>