ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Larry Meadors <lmead...@apache.org>
Subject Re: should "parameterClass" be specified in map xml?
Date Wed, 07 Dec 2005 17:31:32 GMT
Are you getting a SQLException?

Larry


On 12/7/05, Toshiaki Takashima <taka-t@jp.fujitsu.com> wrote:
> Hi there
>
> I defined sql Map definition for select statement
> as follows :
>
>
>  <select id="getBgList" resultClass="Result">
>     SELECT
>       SEQNO  as seqNo,
>       NAME   as name
>     FROM testtable
>     WHERE
>       NME like #paraName#
>  </select>
>
> This Statement works, but following insert statement
> fails when null(java) value is specified to any parameters
> even if you use valid Bean Class which has correct
> properties :
>
>  <statement>
>    INSERT INTO testtable
>    VALUES (
>      #seqNo#,
>      #name#
>    )
>  </statement>
>
> But statement below works fine even if null parameters are
> contained :
>
>  <statement parameterClass="Parameter">
>    INSERT INTO testtable
>    VALUES (
>      #seqNo#,
>      #name#
>    )
>  </statement>
>
>
>
>
> So, I wonder I must specify parameterMap or parameterClass for
> every SQL Map definition.
>
>
> I thought it is just a performance issue for whether you should
> specify parameterMap / parameter Class or not.
>
> Should I always specify parameterMap / parameterClass attribute?
>
> Please teach me !
>
>
> thanks,
>
>
>
>

Mime
View raw message