ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clinton Begin <clinton.be...@gmail.com>
Subject Re: problem with <dynamic>
Date Fri, 27 Jan 2006 03:30:42 GMT
You don't need the <dynamic> tag at all.  Just remove it.  The other
conditionals will work fine.

Cheers,
Clinton

On 1/26/06, Wible, Thomas E <Thomas.E.Wible@mdnt.com> wrote:
>
> i've inherited a mySQL db using a tomcat web-frontend and ibatis sqlmaps
> (the original db designer has since left, natch)-:
> and have picked up the dialect ok until now:
>
> i've added a new column to an existing table, added all the supporting
> java data object code (it retrieves data i've poked into the column just
> fine) but it barfs on the following sqlmap:
>
>     <insert id="insertsql" parameterClass="myclass">
>         insert into mytable set lastchangedate = NOW()
>         <dynamic>
>             <isNotEmpty prepend="," property="oldcolumnvalue">
> `oldcolumnname` = $oldcolumnvalue$
>             </isNotEmpty>
>            <isNotEmpty prepend="," property="newcolumnvalue">
>                 `newcolumnname` = $newcolumnvalue$
>             </isNotEmpty>
>        </dynamic>
>     </insert>
> and i get the following java.sql.SQLexception:
>
>     column not found, msg from server: unknown column 'newcolumnvalue'  in
> 'field list'
>
> somehow the newcolumnvalue is being seen as the newcolumnname...wtf??? the
> new code is cut&pasted from existing(and working, until the mods) code...and
> i've been unsuccessful in getting log4j debug output (java.sql?)to work...
>
> can i buy a clue, please?
> thanx
> tom
>

Mime
View raw message