ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Hurley <brhur...@gmail.com>
Subject Re: what happened to queryForMap?
Date Sun, 21 Mar 2010 21:20:00 GMT
I would think that a more efficient SQL tree query would be much better 
for this case.  That way you get exactly what your looking for then you 
can return the objects back that you need rather then looping though all 
or most of the tree structure in Java.

Read the book by Joe Celko on Tree algorithms for some great info on how 
to deal with this.

Brian Hurley
Leader Spring Dallas User Group

-------- Original Message  --------
Subject: Re: what happened to queryForMap?
From: Rick R <rickcr@gmail.com>
To: user-java@ibatis.apache.org
Date: 03/19/2010 19:52
> On Fri, Mar 19, 2010 at 8:08 PM, Clinton Begin 
> <clinton.begin@gmail.com <mailto:clinton.begin@gmail.com>> wrote:
>     It was liquidated. Honestly I thought it was messy... but maybe I
>     underestimated its usefulness...
> Well, most times I'm using it are for when I have a nested structure 
> defined defined by a parentID column in the same table and you can 
> have n umber of nodes in your tree. I get too lazy trying to figure 
> out how to get an ibatis map populated n-levels deep of nested nodes, 
> so I typically just return a map of all values... key: id, value: 
> thObject.
> Then I just go and manually iterate over the values of the map and add 
> if it has a parentID I find the parent in the map by id and then it as 
> child to the parent. Seem to work pretty well, but maybe there's a 
> more efficient way to build up a tree?

To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org

View raw message