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 Samek Jiri - AZ Direct <ji...@allianzdirect.cz> on 2010/02/05 15:27:42 UTC
Oracle objects mapping in iBatis 3
Hallo,
I have a stored procedure in DB (running on Oracle) with one parameter -
an Oracle object:
create or replace type TEST1STRING as object(
str VARCHAR(50)
)
create or replace
procedure test1(str IN OUT TEST1STRING)
IS
BEGIN
str.str := 'justsometext';
END;
I am trying to call this procedure via iBatis 3.
The following code is for the simplified case when parameter of stored
Procedure is just a VARCHAR. The code is working.
But I am unable to modify it so it would be using the Oracle type and a
specific java type.
<mapper>
...
<select id="test1" statementType="CALLABLE" >
{call test1(#{str,mode=INOUT,jdbcType=VARCHAR})}
</select>
...
<mapper>
<configuration>
...
<typeHandlers>
<typeHandler javaType="String" jdbcType="VARCHAR"
handler="MyTypeHandler"></typeHandler>
</typeHandlers>
...
</configuration>
Any help would be much appreciated.
Jiri Samek
Re: Oracle objects mapping in iBatis 3
Posted by Arpon <th...@mail.inet.hr>.
Samek Jiri - AZ Direct wrote:
>
> Hallo,
>
> I have a stored procedure in DB (running on Oracle) with one parameter -
> an Oracle object:
>
> create or replace type TEST1STRING as object(
> str VARCHAR(50)
> )
>
> create or replace
> procedure test1(str IN OUT TEST1STRING)
> IS
> BEGIN
> str.str := 'justsometext';
> END;
>
> I am trying to call this procedure via iBatis 3.
>
> The following code is for the simplified case when parameter of stored
> Procedure is just a VARCHAR. The code is working.
> But I am unable to modify it so it would be using the Oracle type and a
> specific java type.
>
> <mapper>
> ...
> <select id="test1" statementType="CALLABLE" >
> {call test1(#{str,mode=INOUT,jdbcType=VARCHAR})}
> </select>
> ...
> <mapper>
>
> <configuration>
> ...
> <typeHandlers>
> <typeHandler javaType="String" jdbcType="VARCHAR"
> handler="MyTypeHandler"></typeHandler>
> </typeHandlers>
> ...
> </configuration>
>
> Any help would be much appreciated.
>
> Jiri Samek
>
>
>
I have the same problem. I need to pass complex objects to Oracle stored
procedure via IBatis, and couldn't find
any solutions on the Web.
Since we started to use IBatis 3, I was wondering if it's possible to do
this with the use of annotations ?!?
Cheers,
Apron
--
View this message in context: http://old.nabble.com/Oracle-objects-mapping-in-iBatis-3-tp27468536p28084975.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org