ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niels Beekman" <n.beek...@wis.nl>
Subject RE: Iterate over a List of complax objects
Date Mon, 05 Sep 2005 11:06:34 GMT
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:matt.koranda@edb.com] 
Sent: maandag 5 september 2005 13:03
To: user-java@ibatis.apache.org
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

Mime
View raw message