ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Butler <jeffgbut...@gmail.com>
Subject Re: iBATIS 3 @InsertProvider (and other @*Provider) annotation question
Date Fri, 21 May 2010 15:10:16 GMT
Yes - that works.  iBATIS is using OGNL to interpret the parameters,
so any valid OGNL expression works.

Jeff Butler


On Fri, May 21, 2010 at 10:04 AM, Alex Sherwin
<alex.sherwin@acadiasoft.com> wrote:
> On 5/21/2010 10:23 AM, Alex Sherwin wrote:
>>
>> I just want to make sure, but there is there simply no way to pass
>> arguments to the sql provider method defined in the annotations such as
>> @InsertProvider?
>>
>> It would be very beneficial to be able to do so in terms of building
>> dynamic sql, such as an insert statements for a dynamic number of rows
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
>> For additional commands, e-mail: user-java-help@ibatis.apache.org
>>
>>
>>
> After stepping through the code I've answered my own question, I don't know
> how I missed that before; and I also see it underlined specifically in the
> documentation.. missed that as well somehow.
>
> My next question is, which the documentation doesn't touch upon, is there a
> notation for directly accessing members of an array or list?  Ultimately, my
> question is, in a java sql provider, can I pass in a List/Array of objects
> and generate (pseudo) sql such as this:
>
> insert into tbl (id, field) values (#{ilst[0].id}, #{list[0].field},
> #{list[1].id}, #{list[2].id}, .. )
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
> For additional commands, e-mail: user-java-help@ibatis.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Mime
View raw message