Hi,
You should definitely try things out, you'll be surprised how many
constructs are supported in iBATIS :)
<iterate prepend="AND" property="userList"
open="(" close=")" conjunction="OR">
telephonenumber = #userList[].number# AND
name = #userList[].name#
</iterate>
Or maybe even:
<iterate prepend="AND" property="userList"
open="(" close=")" conjunction="OR">
telephonenumber = #number# AND
name = #name#
</iterate>
Grtz,
Niels
-----Original Message-----
From: Koranda Matthew James [mailto:[EMAIL PROTECTED]
Sent: maandag 5 september 2005 13:03
To: [email protected]
Subject: Iterate over a List of complax objects
I have been using the iterate tag as follows:
<iterate prepend="AND" property="numberList"
open="(" close=")" conjunction="OR">
c.TELEFONNUMBER = #numberList[]#
</iterate>
But application requirements force me to use a more complex object then
just a List of strings because I have to search against 2 fields, I have
created a User object that also contains a name, my hope was to use this
in more of a "JSTL" way to call fields of this object (note the added
"var" paramter):
<iterate prepend="AND" property="userList"
open="(" close=")" conjunction="OR" var="var">
telephonenumber = #var.number# AND
name = #var.name#
</iterate>
This of course doesn't work (though I haven't tried it ;) ) but I was
wondering if this is something that may be considered for future
versions, or more importantly, if anyone has an idea of a work-around.
I hope I have been clear enough.
TIA,
Matt