ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles Bayon <ibatis....@gmail.com>
Subject Re: Some info on referencing a parameter more than once...
Date Tue, 01 Feb 2005 22:42:48 GMT
If you use a parameterMap, you must only declare a parameter once as
you will do in ADO.NET.
For the parmeterClass usage, open a JIRA ticket, I will see it.

-Gilles

On Tue, 1 Feb 2005 14:48:56 -0600, Kit Cragin
<kit.cragin@entervalent.com> wrote:
> I've found that if you reference a property in a parameterClass or an entry
> in a parameterMap more than once, strange behavior results.
> 
> For example (where ... = some legal SQL fragment):
> 
> <select id="whatever" parameterClass="SomeClass">
>  ... #SomeIntProperty# ... #SomeOtherIntProperty# ... #SomeIntProperty# ...
> </select>
> 
> could produce some sort of SQL error (types of errors I've gotten are
> different) or even an error within iBATIS itself before the SQL is sent to
> the database. I *think* the reason is that iBATIS is pulling information
> from the parameterClass or parameterMap by index after mapping the
> parameters to SqlParameters.
> 
> The workaround is to do something like this:
> 
> <select id="whatever" parameterClass="SomeClass">
>  declare @SP int
>  select @SP = #SomeIntProperty#
>  ... @SP ... #SomeOtherIntProperty# ... @SP ...
> </select>
> 
> Hope this saves someone some time. Can anyone confirm this issue? If so, I
> can enter into Jira.
> 
> - Kit
> 
>

Mime
View raw message