ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicholoz Koka Kiknadze" <kikna...@gmail.com>
Subject Re: <update> with parameterMap and parameterClass ?
Date Wed, 26 Nov 2008 14:16:07 GMT
On Wed, Nov 26, 2008 at 8:05 AM, Alejandro D. Garin <agarin@gmail.com>wrote:

> Hi Ingmar
>
>
>> provide an instance of Person as parameter, witch contains the values to
>> store.
>>
>> <update id="update1" parameterClass="Person">
>>  UPDATE Person SET
>>    name = #name:VARCHAR#,
>>    lastname = #lastname:VARCHAR#
>>  WHERE id = #id:INTEGER#
>> </update>
>>
>
> OK, but, what if I have defined a parameterMap for an <insert>? can't reuse
> it for an <update> statement?
>

Sure you can reuse it:
<update id="update1" parameterMap="personMap"> ... </update>

You can not use BOTH parameterMap and parameterClass in a single update
definition, so if you already have defined and populated your parameterMap,
go ahead, use it.

Mime
View raw message