You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Rick R <ri...@gmail.com> on 2010/03/19 22:19:42 UTC

what happened to queryForMap?

I really though queryForMap was cool. I'm looking for how to do it in
ibatis3 but don't see a way. Doesn't seem to exist as a select type on the
Session (and don't see it in the docs.)
Was it canned in ibatis3, if so, just curious why? (Granted it's not hard to
build a Map in java after I get my list, but hey it was one less step I had
to do using ibatis queryForMap)

-- 
Rick R

Re: what happened to queryForMap?

Posted by Brian Hurley <br...@gmail.com>.
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.



Regards,
Brian Hurley
Secretary@JavMUG.org
Leader Spring Dallas User Group




-------- Original Message  --------
Subject: Re: what happened to queryForMap?
From: Rick R <ri...@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 <ma...@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


Re: what happened to queryForMap?

Posted by Rick R <ri...@gmail.com>.
On Fri, Mar 19, 2010 at 8:08 PM, Clinton Begin <cl...@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?

Re: what happened to queryForMap?

Posted by Clinton Begin <cl...@gmail.com>.
It was liquidated. Honestly I thought it was messy... but maybe I
underestimated its usefulness...

Clinton

On Fri, Mar 19, 2010 at 3:19 PM, Rick R <ri...@gmail.com> wrote:

> I really though queryForMap was cool. I'm looking for how to do it in
> ibatis3 but don't see a way. Doesn't seem to exist as a select type on the
> Session (and don't see it in the docs.)
> Was it canned in ibatis3, if so, just curious why? (Granted it's not hard
> to build a Map in java after I get my list, but hey it was one less step I
> had to do using ibatis queryForMap)
>
> --
> Rick R
>