You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by gumnaam23 <vk...@yahoo.com> on 2008/06/04 16:39:01 UTC

Support for Oracle's CURSOR expression.

Will it be possible to add support for Oracle's Cursor expression ?

e.g. something like this

select d.id, d.name, cursor(select e.id,e.name from employee e where
e.id_dept = d.id) as employees from dept d;

The jdbc type for the 3rd column is CURSOR or more specifically ORACLEREF
(Ref cursor)
, and the javatype is a ResultSet. i.e. a resultset within a resultset.

Seeing that iBaits already supports Oracle's RefCursor for OUT parameters of
a procedure call, i thought it might not be a big deal to support it for
select call as well.

I tried something like
<resultMap id="deptResult" class="Dept">
    <result property="id" column="id" jdbcType="NUMBER" javaType="int" />
    ...
    <result property="emps" javaType="list" jdbcType="ORACLECURSOR"
resultMap="empResult" />
</resultMap>

But, when the emps list is being generated, the values for "empResult"
result map are retrieved from the original result set, rather than the
result set that is returned as the 3 column of the query.

So I suspect it's only a matter of changing the result map processing part
to retrieve the correct result set from the query's result set , when the
column type is oraclecursor.

-- 
View this message in context: http://www.nabble.com/Support-for-Oracle%27s-CURSOR-expression.-tp17648347p17648347.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.