Uploaded image for project: 'iBatis for .NET'
  1. iBatis for .NET
  2. IBATISNET-183

Prepend for delete doesn't work

    XMLWordPrintableJSON

Details

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

      Attachments

        Activity

          People

            Unassigned Unassigned
            sema Ramon Luo
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: