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 Sundar Sankar <fa...@gmail.com> on 2008/01/10 17:00:05 UTC
How to handle rowtype in parameter when calling a stored procedure
Hi,
I have a stored procedure that takes rowtype, an instance of a table,
in my database. How do you create the mapping for such kind of case. Does
Ibatis support this?
Regards
Sundar Sankarnarayanan
Re: How to handle rowtype in parameter when calling a stored procedure
Posted by Sundar Sankar <fa...@gmail.com>.
The parameterMap id was procParam. and not one I have mentioned below. Sorry
about that.
On Jan 10, 2008 9:17 AM, Sundar Sankar <fa...@gmail.com> wrote:
> I am new to accessing stored procs as such. I don't know how I would do
> it JDBC. I had an example with Springs jdbcTemplate where my jdbcType was
> ARRAY. But no matter what I give the type as(ARRAY, OBJECT, CURSOR) ibatis
> was throwing me an UncatergorizedSQLException or a NullPointer exception and
> asked me to check the mapping for the property. I had tried having a
> resultMap too mapping, an object where each of the columns where mapped to
> properties. I also made sure in the unit test that none of the properties
> were Null.
>
> Still I am getting this error.
>
>
> My Mapping file is something like this
>
>
>
> <parameterMap id="procParam" class="map">
> <parameter property="p_property" jdbcType="OTHER" javaType="
> com.model.modelClass"
> mode="IN"/>
> <parameter property="p_prop2" jdbcType="NUMBER"
> javaType="java.lang.Long" mode="IN" />
> </parameterMap>
>
> <procedure id="proc"
> parameterMap="procParam">
> {call
> theProc(?,?)}
> </procedure>
>
> <resultMap
> class="com.model.modelClass"
> id="transcriptActivity">
> <result
> .
> .
> .
> .
> .
> </resultMap>
>
> I have tried changing the parameterMap to various formats where the
> jdbcType have been all that I have mentioned and have also tried including
> the resultMap as as the map below. In my unit test, I set in values to all
> the properties explicitly, leaving nothing null.
>
> Regards
> Sundar Sankarnarayanan
>
>
> On Jan 10, 2008 9:04 AM, Larry Meadors <lm...@apache.org> wrote:
>
> > How would you do it with JDBC?
> >
> > Larry
> >
> >
> > On Jan 10, 2008 9:00 AM, Sundar Sankar <fatboysuns@gmail.com > wrote:
> > > Hi,
> > > I have a stored procedure that takes rowtype, an instance of a
> > table,
> > > in my database. How do you create the mapping for such kind of case.
> > Does
> > > Ibatis support this?
> > >
> > > Regards
> > > Sundar Sankarnarayanan
> > >
> >
>
>
Re: How to handle rowtype in parameter when calling a stored procedure
Posted by Sundar Sankar <fa...@gmail.com>.
I am new to accessing stored procs as such. I don't know how I would do it
JDBC. I had an example with Springs jdbcTemplate where my jdbcType was
ARRAY. But no matter what I give the type as(ARRAY, OBJECT, CURSOR) ibatis
was throwing me an UncatergorizedSQLException or a NullPointer exception and
asked me to check the mapping for the property. I had tried having a
resultMap too mapping, an object where each of the columns where mapped to
properties. I also made sure in the unit test that none of the properties
were Null.
Still I am getting this error.
My Mapping file is something like this
<parameterMap id="saveOrUpdateCoursesParam" class="map">
<parameter property="p_property" jdbcType="OTHER" javaType="
com.model.modelClass"
mode="IN"/>
<parameter property="p_prop2" jdbcType="NUMBER"
javaType="java.lang.Long" mode="IN" />
</parameterMap>
<procedure id="proc"
parameterMap="procParam">
{call
theProc(?,?)}
</procedure>
<resultMap
class="com.model.modelClass"
id="transcriptActivity">
<result
.
.
.
.
.
</resultMap>
I have tried changing the parameterMap to various formats where the jdbcType
have been all that I have mentioned and have also tried including the
resultMap as as the map below. In my unit test, I set in values to all the
properties explicitly, leaving nothing null.
Regards
Sundar Sankarnarayanan
On Jan 10, 2008 9:04 AM, Larry Meadors <lm...@apache.org> wrote:
> How would you do it with JDBC?
>
> Larry
>
>
> On Jan 10, 2008 9:00 AM, Sundar Sankar <fa...@gmail.com> wrote:
> > Hi,
> > I have a stored procedure that takes rowtype, an instance of a
> table,
> > in my database. How do you create the mapping for such kind of case.
> Does
> > Ibatis support this?
> >
> > Regards
> > Sundar Sankarnarayanan
> >
>
Re: How to handle rowtype in parameter when calling a stored procedure
Posted by Larry Meadors <lm...@apache.org>.
How would you do it with JDBC?
Larry
On Jan 10, 2008 9:00 AM, Sundar Sankar <fa...@gmail.com> wrote:
> Hi,
> I have a stored procedure that takes rowtype, an instance of a table,
> in my database. How do you create the mapping for such kind of case. Does
> Ibatis support this?
>
> Regards
> Sundar Sankarnarayanan
>