ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Nabours <MNabo...@peabodyenergy.com>
Subject Re: utilizing nested iterate tags in SQL Map xml file -- is it supported?
Date Thu, 01 Dec 2005 16:55:40 GMT
Hi Jeff,

Thanks for the quick answer.

We have an acceptable work-around by providing a getter method on the
parameter object that returns a list of maps with a map for every
combination we need (for example (team id,player id)).  We then use the
iterate tag to iterate over the list of maps.  (Sweet that iBATIS goes
through the getter methods!)

Keep up the great work!

Thanks,
Mark




|---------+--------------------------------->
|         |                      Jeff Butler|
|         |            <jeffgbutler@gmail.co|
|         |                               m>|
|         |                                 |
|         |              12/01/2005 10:30 AM|
|         |                                 |
|         |                                 |
|         |                Please respond to|
|         |            user-java@ibatis.apac|
|         |                           he.org|
|         |                                 |
|---------+--------------------------------->
  >----------------------------------------------------------------------------------------------------------------------|
  |                                                                                      
                               |
  |                                                                                      
                               |
  |                                                                                      
                             To|
  |        user-java@ibatis.apache.org                                                   
                               |
  |                                                                                      
                             cc|
  |                                                                                      
                               |
  |                                                                                      
                        Subject|
  |        Re: utilizing nested iterate tags in SQL Map xml file -- is it supported?     
                               |
  |                                                                                      
                               |
  |                                                                                      
                               |
  |                                                                                      
                               |
  |                                                                                      
                               |
  |                                                                                      
                               |
  >----------------------------------------------------------------------------------------------------------------------|




Hi Mark,

The DTD allows nested iterate tags, but they don't really work the way you
(and I) would like them to.  The problem is that there is no method for
tags inside an iterate tag to refer to the current object in the iterate
loop (like the "var" property of JSTL's forEach tag).  So, even though the
tags can be nested, the "property" attribute must always refer to a
property of the parameter object.  Not very useful in your situation.

I think changing this would be a great addition to the function of the
iterate tag.  Oh for more hours in the day to work on improving iBATIS!

Jeff Butler


On 11/30/05, Mark Nabours <MNabours@peabodyenergy.com> wrote:

  Hi all,

  In our parameter object we are passing to the SQLMapClient for a SQL
  select, we have an ArrayList of objects of a particular class (for
  example
  team).  Each element in that ArrayList contains a list of objects of a
  related class (for example player).  Is it possible to iterate over both
  lists by nesting iterate tags in the SQL map file?

  If it is possible, are there examples on how to do this?  We've tried
  everything we could think of but without any luck.

  Thanks for your help,
  Mark


  -----------------------------------------
  E-mail Disclaimer:
  The information contained in this e-mail, and in any accompanying
  documents, may constitute confidential and/or legally privileged
  information.  The information is intended only for use by the
  designated recipient.  If you are not the intended recipient (or
  responsible for the delivery of the message to the intended recipient),
  you are hereby notified that any dissemination, distribution, copying,
  or other use of, or taking of any action in reliance on this e-mail
  is strictly prohibited. If you have received this email communication
  in error, please notify the sender immediately and delete the message
  from your system.




Mime
View raw message