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

Pound signs not handled correctly when used in combination with $Foo$ syntax and dynamic sql.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • DataMapper 1.1
    • DataMapper 1.2.0
    • None
    • None
    • IBatisNet.DataMapper
      [assembly: AssemblyVersion("1.1.458")]

    Description

      When the following syntax is used:

      ##$Foo$##

      and Foo is set via:

      map["Foo"] = new DateTime(2005, 1, 2, 3, 4, 5);

      Ibatis seems to process the line correctly. I expect the following text to be sent to the database:

      #1/2/2005 3:04:05#

      The logs don't explicitly state that that text is being sent to the database but the code seems to work correctly.

      When a dynamic sql block is used with the ##$Foo$## syntax, Ibatis incorrectly throws a ProbeException because it tries to re-evaluate "1/2/2005 3:04:05" as a key in the Hashtable. For example this snippet of text:

      (Concert.ConcertDate = ##$StartDate$##)
      <isNotEmpty prepend="AND" property="EndDate">
      (Concert.ConcertDate = ##$EndDate$##)
      </isNotEmpty>

      Raises a ProbeException with the following error message: There is no Get property named '1/2/2005 3' in class 'Hashtable'. The next character after the 3 is a colon which Ibatis uses for inline parameters. It appears that Ibatis is trying to re-evaluate what's between the dollar signs.

      Attachments

        Activity

          People

            gilles Gilles Bayon
            ron liu ron
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: