title: MyBatis full annotation config to retrieve stored procedure result in OUT parameter?
body: <p>We have an Oracle stored procedure that returns its results in a SYS_REFCURSOR type OUT parameter. We would like to call this through a MyBatis mapper, the relevant part of the query string in the @Select annotation looks as follows</p>
  
  <pre><code>@Select(value="call " + SCHEMA_NAME + "." + STORED_PROCEDURE_NAME +
        "(" + ...
        "#{" + P_RECORDSET_FIELD + ",javaType=java.sql.ResultSet,jdbcType=CURSOR,mode=OUT,resultMap=ownNameSpace.ownResultMap}," + 
         ...
  </code></pre>
  
  <p>where the resultMap property refers to the following XML configuration</p>
  
  <pre><code>&lt;mapper namespace="ownNameSpace"&gt;
    &lt;resultMap id="ownResultMap" type="com.ownpackage.OwnResultType"&gt;
      &lt;result column="COLUMN_1" property="property1" /&gt;
      ...
  </code></pre>
  
  <p>This works perfectly, the expected results are succesfully retrieved from the DB by the DAO class using the mapper. However we wonder whether it is possible to solve this without XML, using annotations only. MyBatis has @Results/@Result/@ResultMap annotation which we succesfully use for SPs with ResultSet but so far we could not really find a solution for OUT parameters. Similar examples usually boil down to using a mixed annotations+XML configuration. E.g. the author of the following tutorial seems to stuck with the same issue, though it is a few years old: <a href="https://dzone.com/articles/ibatis-mybatis-working-stored" rel="nofollow">https://dzone.com/articles/ibatis-mybatis-working-stored</a> (see Annotation for Fourth Example) Is this feasible at all?</p>