ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stevens, Ian" <IStev...@globeandmail.com>
Subject RE: Implicit map/list for result set of stored procedure call?
Date Mon, 20 Jul 2009 17:11:01 GMT
Am I to understand that iBatis needs a column name mapping, otherwise no
columns are stored in the map? There's no way to short-circuit this
behaviour and just place the columns in a hash map keyed on the original
column names? I need a more dynamic map as the stored procedure I am
using returns a different cursor depending on the results. Any


	From: Stevens, Ian [mailto:IStevens@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
	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"/>
	     <parameterMap id="params" class="map">
	         <parameter property="po_rc"
javaType="java.sql.ResultSet" jdbcType="ORACLECURSOR" mode="OUT"
	         <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"/>
	     <procedure id="getData" parameterMap="params">
	         {call pkg.foo(?,?,?,?)}
	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?

View raw message