FYI, I'm now using a linkedhashmap instead of hashmap for the resultMap,
but still need to specify all the columns as results.
 
Ian.


________________________________

        From: Stevens, Ian [mailto:istev...@globeandmail.com] 
        Sent: July 16, 2009 3:10 PM
        To: user-java@ibatis.apache.org
        Subject: Implicit map/list for result set of stored procedure
call?
        
        
        I'm trying to grab data from an Oracle stored procedure using
iBatis 2.3.4. I have something like the following in my XML:
         
             <resultMap id="result" class="hashmap">
                 <result property="year" column="YEAR"/>
             </resultMap>
             <parameterMap id="params" class="map">
                 <parameter property="po_rc"
javaType="java.sql.ResultSet" jdbcType="ORACLECURSOR" mode="OUT"
resultMap="result"/>
                 <parameter property="po_rec_cnt"
javaType="java.lang.Long" jdbcType="BIGINT" mode="OUT"/>
                 <parameter property="po_currency_flag"
javaType="java.lang.Long" jdbcType="BIGINT" mode="OUT"/>
                 <parameter property="pi_company_id" jdbcType="NUMBER"
javaType="java.lang.Long" mode="IN"/>
             </parameterMap>
             <procedure id="getData" parameterMap="params">
                 {call pkg.foo(?,?,?,?)}
            </procedure>
        
        There are a number of columns in the result set. Is it possible
to have the procedure implicitly populate a map with each row of the
results? or do I have to explicitly specify mappings for each column
like I did with YEAR above? I just need the values in the order they
appear as columns.
         
        Better still, can I have the result populated as a list of
lists, one list per row containing the values of the columns in order?
         
        thanks,
        Ian.

Reply via email to