ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ext_Friedrich, Stefan" <Stefan.Friedr...@sungard.de>
Subject HashMap of Lists of HashMaps
Date Thu, 09 Feb 2006 12:26:59 GMT

We encountered a little problem that we are not able to solve by

What we want to do is: Use HashMaps instead of DOM in the resultMapping.
Here's a sample of what we want to do:

<resultMap id="a" class="java.util.HashMap">
	<result property="aa" select="loadAA"/>
	<result property="id" column="id"/>
<select id="loadA" resultMap="a">
	Select id from tableA where id = 1

<resultMap id="aa" class="java.util.HashMap">
	<result property="id" column="id"/>
<select id="loadAA" resultMap="aa">
	Select id from tableA

The first select returns one result --> a HashMap, the second select
returns numerous results --> n HashMaps that should be mapped as a List
of HashMaps.

When we implement it as a DOM and exchange the classes in the resultMaps
with the ones below, the same code works fine:

class A {
	private Collection aa;
	private int id;
	//getters and setters

class AA {
	private int id;

Is there a solution for our problem, because we want to avoid the use of
a DOM due to flexibility-reasons

Stefan Friedrich

View raw message