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

Reply via email to