ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Larry Meadors <lmead...@apache.org>
Subject Re: HashMap of Lists of HashMaps
Date Fri, 10 Feb 2006 15:06:28 GMT
What do you mean by DOM?

Larry


On 2/9/06, Ext_Friedrich, Stefan <Stefan.Friedrich@sungard.de> wrote:
>
>
> Hello.
>
> We encountered a little problem that we are not able to solve by ourselves:
>
> 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"/>
> </resultMap>
> <select id="loadA" resultMap="a">
>         Select id from tableA where id = 1
> </select>
>
> <resultMap id="aa" class="java.util.HashMap">
>         <result property="id" column="id"/>
> </resultMap>
> <select id="loadAA" resultMap="aa">
>         Select id from tableA
> </select>
>
> 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
>
> Thanks
> Stefan Friedrich

Mime
View raw message