ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <steven...@gmail.com>
Subject Re: about the iterate usage
Date Thu, 09 Feb 2006 01:09:49 GMT
Dear Niels,

Thanks for your warm-heared and helpful reply, I will try it.

Thanks again.

Steven


On 2/9/06, Niels Beekman <n.beekman@wis.nl> wrote:
>
> Hi,
>
> I'm not sure I understand your question, but the <iterate>-tag supports
> (amongst others) all Collection implementations (so ArrayList is supported)
> and arrays. You do not have to change anything in your first query to make
> it work. The []-syntax is there to let iBATIS know it should retrieve
> property values from the current item of the loop.
>
> Hope this helps,
>
> Niels
>
> ________________________________________
> From: stevenlou@gmail.com [mailto:stevenlou@gmail.com]
> Sent: woensdag 8 februari 2006 17:25
> To: user-java@ibatis.apache.org
> Subject: about the iterate usage
>
> Dear all,
>
> I know "iterate" is of java.util.List, so I have to initial the length for
> the array in Java. Generally it use brackets[].
> <iterate property="fruits" conjunction=",">
> (#fruits[].id#, #fruits[].name#)
> </iterate>
>
> Now I need insert some data, and the length is not fixed. So can I use the
> arraylist to replace list? Writing like this:
> <iterate property="fruits" conjunction=",">
> (#fruits.getid()#, #fruits.getname()#)
> </iterate>
>
> Thanks so much for your warm-hearted help.
>
> Steven
>

Mime
View raw message