You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using ibatis-2.3.4.726.jar
I've got nested isNotEquals with prepends (AND)
<dynamic prepend="WHERE">
<isEqual property="CategoryType" compareValue="Pattern">
Category LIKE #Category#
</isEqual>
<isNotEqual property="CategoryType" compareValue="Variable">
<isNotEqual property="CategoryType" compareValue="Pattern">
Category = #Category#
</isNotEqual>
</isNotEqual>
<isEqual prepend="AND" property="VRL_OS_Type" compareValue="Pattern">
VRL_OS LIKE #VRL_OS#
</isEqual>
<isNotEqual prepend="AND" property="VRL_OS_Type" compareValue="Variable">
<isNotEqual property="VRL_OS_Type" compareValue="Pattern">
VRL_OS = #VRL_OS#
</isNotEqual>
</isNotEqual>
<isEqual prepend="AND" property="VRL_Test_Name_Type" compareValue="Pattern">
VRL_Test_Name LIKE #VRL_Test_Name#
</isEqual>
<isNotEqual prepend="AND" property="VRL_Test_Name_Type" compareValue="Variable">
<isNotEqual property="VRL_Test_Name_Type" compareValue="Pattern">
VRL_Test_Name = #VRL_Test_Name#
</isNotEqual>
</isNotEqual>
</dynamic>
When all three (CategoryType, VRL_OS_Type, and VRL_Test_Name_Type) are
"Constant" (i.e not equal to anything in the query), you would expect to get
SQL like
WHERE Category = #Category# AND VRL_OS = #VRL_OS# AND VRL_Test_Name = #VRL_Test_Name#
Instead, I'm getting SQL like
WHERE Category = ? VRL_OS = ? AND VRL_Test_Name = ?
I tried putting the prepend in BOTH the outer and inner nested isNotEquals,
then I ended up with TWO ANDs.
WHERE Category = ? AND VRL_OS = ? AND AND VRL_Test_Name = ?
I ended up putting a prepend in BOTH the outer and inner isNotEquals of the
second section, but only the outer isNotEquals of the third section, and that
finally generated the desired output.
Original issue reported on code.google.com by sst...@gmail.com on 2 Jul 2010 at 12:46
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
sst...@gmail.com
on 2 Jul 2010 at 12:46The text was updated successfully, but these errors were encountered: