ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wible, Thomas E" <Thomas.E.Wi...@mdnt.com>
Subject RE: Selective Update of fields depending on values in object
Date Thu, 16 Feb 2006 12:45:03 GMT
while my predecessor didn't grok the difference between $delimiter$ &
#delimiter#, he did come up with exactly what u r looking 4:
 <resultmap id='parameter' class='my.param.obj'>
    <result property='id'        column='id'> 
    <result property='name' column='name'>
    <result property='date'   column='date'>
    <result property='value'   column='value'>
<update id='updateParam' parameterClass='my.param.obj'>
    UPDATE paramTable SET
            <isNotNull prepend="," property="name">
                name = $name$
            <isNotNull prepend="," property="date">
                date = $date$
            <isNotNull prepend="," property="value">
                value= $value$
    WHERE id = $id$
when i've added columns, i've had to use the # delimiter, but the above
works just fine 4 me;-)

View raw message