ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Abdullah Kauchali <abdullah.kauch...@isanusi.com>
Subject [SOLVED]: Dynamic Prepend and removal of "beginning" prepends
Date Wed, 03 Aug 2005 17:52:59 GMT
Ok, found an answer from the archives:

I need to sandwitch everything within the dynamic tag with this:

        <isParameterPresent removeFirstPrepend="true">
...

         </isParameterPresent>

This feature definitely needs to be documented.

Cheers

Abdullah


Abdullah Kauchali wrote:

> <insert id="create" parameterClass="DirectoryTypeBean">
>
> INSERT INTO SEC_DirectoryType (
>      <dynamic prepend="">               <isNotEmpty prepend="," 
> property="directoryType_Code">
>            DirectoryType_Code
>        </isNotEmpty>
>        <isNotEmpty prepend="," 
> property="directoryType_ConnectionFactory">
>            DirectoryType_ConnectionFactory
>        </isNotEmpty>
>        <isNotEmpty prepend="," property="directoryType_JavaApiValues">
>            DirectoryType_JavaApiValues
>        </isNotEmpty>
>        <isNotEmpty prepend="," property="directoryType_DotNetApiValues">
>            DirectoryType_DotNetApiValues
>        </isNotEmpty>
>
>        .....
>
> </dynamic>
>
>
> I get incorrect SQL syntax when the first value is empty - iow:  there 
> is a comma before the first column.
>
> INSERT INTO SEC_DirectoryType (    ,   DirectoryType_ConnectionFactory 
> ....
>
> What do I do to get rid of the first comma?
>
> TIA,
>
> Kind regards
>
> Abdullah
>

Mime
View raw message