ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From KwonNam Son <kwon3...@gmail.com>
Subject When there are no statement, iBatis throws an exception.
Date Thu, 27 Oct 2005 08:27:13 GMT
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.

Mime
View raw message