ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alejandro D. Garin" <aga...@gmail.com>
Subject Re: <update> with parameterMap and parameterClass ?
Date Thu, 27 Nov 2008 17:24:37 GMT
Great!
Thank you Nicholoz.

On Wed, Nov 26, 2008 at 8:32 PM, Nicholoz Koka Kiknadze
<kiknadze@gmail.com>wrote:

>     <parameterMap id="messageParameterMap" class="Message">
>>         <parameter property="id1" jdbcType="INTEGER"/>
>>         <parameter property="id2" jdbcType="INTEGER"/>
>>         <parameter property="messageCount" jdbcType="INTEGER" />
>>         <parameter property="title" jdbcType="VARCHAR"/>
>>     </parameterMap>
>>
>>     <insert id="insertMessage" parameterMap="messageParameterMap" >
>>         INSERT INTO MSGS ( SY_ID1, SY_ID2, MS_COUNT, MS_TITLE)
>>         VALUES (#id1#,#id2,#messageCount#,#title#)
>>     </insert>
>>
>>     <update id="update" parameterMap="messageParameterMap" >
>>         UPDATE MSGS SET MS_COUNT=#messageCount#, MS_TITLE=#title# WHERE
>> SY_ID1=#id1# AND SY_ID2 = #id2#
>>     </update>
>>
>>
> I.e. for selects/crud replace question marks with actual property name
> enclosed with ##.
> However you'll have to use questionmark placeholders when calling stored
> procedures, and there you'll need to care about the order in your parameter
> map.
>

Mime
View raw message