ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "jonte.eriksson" <jonte.eriks...@gmail.com>
Subject choose and otherwise
Date Mon, 30 Nov 2009 18:24:24 GMT

Hi,

I've been trying out iBATIS 3.0 beta 5 and according to the documentation
the <choose>, <when> and <otherwise> should work as a normal switch case.
I
have a merge update statement and uses a choose like following:

<choose>
     <when test="#{booleanProperty}">
                WHEN NOT MATCHED THEN
                INSERT (column)
                    VALUES (temp.column)
      </when>
      <otherwise>
                WHEN MATCHED THEN
                DELETE
      </otherwise>
</choose>

The problem is that the <otherwise> section is never included, no matter of
the value of the booleanProperty.

If I change to using <if> it works.

<if test="#{booleanProperty}">
         WHEN NOT MATCHED THEN
         INSERT (column)
             VALUES (temp.column)
</if>
<if test="#{!booleanProperty}">
         WHEN MATCHED THEN
                DELETE
</if>

Is this a bug in the <choose> tag or have I misunderstood how it is supposed
to work?

Thanks for a great framwork!
/Jonas
-- 
View this message in context: http://old.nabble.com/choose-and-otherwise-tp26579494p26579494.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Mime
View raw message