ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Pitts" <Daniel.Pi...@cnet.com>
Subject Map from id->list
Date Mon, 14 Aug 2006 23:25:06 GMT
I have a table that looks something like this:

		external_maps
Parent	externalId		type
1			1		1
1			2		1
1			3		1
1			8		2
1			9		2
1			16		6

I want to do a query like "SELECT externaId, type FROM external_maps
where Parent=%parent%"

I want to get a result that is a Map<Integer, Integer[]> (or
Map<Integer, List<Integer>>) where the key is type and the Integer[] (or
List<Integer)) is the list of externalId values.

Will queryForMap do this? If not, is there another (easy) way to get
this result?

Thanks,
Daniel.

Mime
View raw message