Prepend for delete doesn't work
-------------------------------
Key: IBATISNET-183
URL: http://issues.apache.org/jira/browse/IBATISNET-183
Project: iBatis for .NET
Issue Type: Bug
Components: DataMapper
Affects Versions: DataMapper 1.5.1
Reporter: Ramon Luo
My database is MS Access. I use Visual Studio 2003. english version.
I use following statement
<delete id="Delete" parameterClass="Message">
Delete from Message Where
<isNotNull prepend="AND" property="Key">
Key = #Key#
</isNotNull>
<isNotNull prepend="AND" property="CID">
CID = #CID#
</isNotNull>
<isNotNull prepend="AND" property="Direction">
Direction = #Direction#
</isNotNull>
<isNotNull prepend="AND" property="Type">
Type = #Type#
</isNotNull>
<isNotNull prepend="AND" property="StartTime">
StartTime = #StartTime#
</isNotNull>
<isNotNull prepend="AND" property="EndTime">
EndTime = #EndTime#
</isNotNull>
</delete>
Then I create a Message object in my code, and call the SQL by
mapper.Delete("Message.Delete", message);
I debug the code and found that the SQL statement is created as
"Delete from Message Where AND Key = ? AND CID = ? AND Direction = ? AND Type =
? AND StartTime = ? AND EndTime = ?"
I wondered why the "AND" before "Key = ?" appeared.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira