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

Support inline paramaters and dynamic element in procedure tag

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • DataMapper 3.0
    • DataMapper 3.0
    • DataMapper
    • None

    Description

      Samples
      ========

      <procedure id="SPWithInlineParameter" parameterClass="int" resultClass="Account">
      ps_SelectAccount @

      {Account_ID,column=Account_ID}
      </procedure>

      <procedure id="SPWithInlineParameterAndOutPutParam" parameterClass="map" resultClass="Account">
      ps_SelectAccountWithOutPutParam @{Account_ID,column=Account_ID}

      , @

      {OutPut,column=OutPut}

      </procedure>

      <procedure id="InsertAccountViaSPAndInlineParameter" parameterClass="map" >
      ps_InsertAccount
      @

      {Id,column=Account_ID},
      @{FirstName,column=Account_FirstName},
      @{LastName,column=Account_LastName},
      @{EmailAddress,column=Account_Email,nullValue=no_email@provided.com},
      @{BannerOption,column=Account_Banner_Option,dbType=Varchar,type=bool},
      @{CartOption,column=Account_Cart_Option,handler=HundredsBool}
      </procedure>

      <procedure id="InsertAccountViaSPWithDefaultParameter" parameterClass="map" >
      ps_InsertAccountWithDefault
      @{Id,column=Account_ID}

      ,
      @

      {FirstName,column=Account_FirstName},
      @{LastName,column=Account_LastName},
      @{EmailAddress,column=Account_Email,nullValue=no_email@provided.com}
      </procedure>

      <procedure id="InsertAccountViaSPWithDynamicParameter" parameterClass="map" >
      ps_InsertAccountWithDefault
      @{Id,column=Account_ID}
      ,@{FirstName,column=Account_FirstName}

      ,@

      {LastName,column=Account_LastName}

      ,@

      {EmailAddress,column=Account_Email,nullValue=no_email@provided.com}

      <isNotNull property="NullBannerOption">
      ,@

      {NullBannerOption,column=Account_Banner_Option,dbType=Varchar,type=bool}

      </isNotNull>
      @

      {CartOption,column=Account_Cart_Option,handler=HundredsBool}

      </procedure>

      Can be use in conjunction with procedure default parameter
      REATE PROCEDURE dbo.[ps_InsertAccountWithDefault]
      @Account_ID [int],
      @Account_FirstName [nvarchar](40),
      @Account_LastName [varchar](32),
      @Account_Email [varchar](128),
      @Account_Banner_Option [varchar](255)='Non',
      @Account_Cart_Option [int] =200
      AS
      ...

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: