ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gumnaam23 <vkbhas...@yahoo.com>
Subject Support for Oracle's CURSOR expression.
Date Wed, 04 Jun 2008 14:39:01 GMT

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.


Mime
View raw message