ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Koranda Matthew James" <matt.kora...@edb.com>
Subject RE: Iterate over a List of complax objects
Date Tue, 06 Sep 2005 08:11:34 GMT
:) I stand corrected, it works fine the way you describe in your first
example.

It is easy to assume if there isn't a concrete example of the way you
want to do something that it doesn't exist. Which brings us to
documentation, I would be happy to add an example of this in the
appropriate section.... any ideas where that might be?

Matt

-----Original Message-----
From: Niels Beekman [mailto:n.beekman@wis.nl] 
Sent: 5. september 2005 13:07
To: user-java@ibatis.apache.org
Subject: RE: Iterate over a List of complax objects

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