You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by KwonNam Son <kw...@gmail.com> on 2005/10/27 10:27:13 UTC

When there are no statement, iBatis throws an exception.

I have some insert statement like the follwoing...

<insert id="idInsert" parameterClass="java.util.Map">
   <isNotEmpty property="p_share">
    INSERT INTO TMLBC060 (
     USER_ID, RIGHT_CODE, SERVICE_CODE, SERVICE_SHARE
    ) VALUES (
     #p_user_id#, #p_share_right_code#, #p_share_service_code#, #p_share#
    )
   </isNotEmpty>
  </insert>

When p_share property is empty, IdInsert has no statement in it. This
statement runs in a batch.
In this condition, iBatis throws an exception.

Is there any way of preventing throwing an excetion?

Because of some complicated reasons, It's very difficult to check
p_share property in Java.
Also, I could make an dummy insert statement(like "insert into dummy
select 'x' from dual where 1=0;"), but I hope I could avoid that kind
solution.

Thanks,
KwonNam.