ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Butler" <jeffgbut...@gmail.com>
Subject Re: resultMap HashMap and with a list
Date Tue, 27 Nov 2007 19:58:20 GMT
iBATIS will not do this on its own.  You could probably do it with a
custom rowHandler.

Jeff Butler



On Nov 27, 2007 1:50 PM, eznibe <enbertran@gmail.com> wrote:

>
> Hi All,
>
> can someone tell me if this can be done...
>
> QRY
>
> Select type, name
> from table
> order by type, name
>
> where the result will be
>
> TYPE NAME
> type1 aaa
> type1 bbb
> type2 ccc
> type3 axzd
>
>
> I want a map with 3 Keys (type1, type2, and type3) and the value of each
> Key
> is the list or Names?
>
> can this be done... i tried this and no luck
>
> <resultMap id="get-types" class="java.util.HashMap" groupBy="key">
> <result property="key" column="name" />
> <result property="val" resultMap="get-names"/>
> </resultMap>
>
>
> <resultMap id="get-names" class="java.util.ArrayList">
> <result property="name" resultMap="name" />
> </resultMap>
>
>
> <select id="retrieveRelatedTo" resultMap="get-cnt-cnt-connections">
> Select type, name
> from table
> order by type, name
> </select>
>
>
> Thanks
> --
> View this message in context:
> http://www.nabble.com/resultMap-HashMap-and-with-a-list-tf4883952.html#a13978244
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com<http://nabble.com/>
> .
>
>

Mime
View raw message