Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
DataMapper 1.5.1
-
None
-
None
Description
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.