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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
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

Reply via email to