ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Toshiaki Takashima <tak...@jp.fujitsu.com>
Subject should "parameterClass" be specified in map xml?
Date Wed, 07 Dec 2005 16:48:52 GMT
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