ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anita m <anita1...@yahoo.com>
Subject Re: Returning hashmap of objects instead of list
Date Fri, 14 Apr 2006 00:36:40 GMT
How can I specify that I want the productname to be
the keys for may hashmap ?

--- Neverov Dm <neverov_dg@nkmk.ru> wrote:

> Hi, anita.
> 
> maybe it helps:
> 
> <resultMap id="mymap.products"
> class="java.util.HashMap" >
> <result property="name" column="productname"/>
> </resultMap>
> 
> ---------------------------------
> You wrote 13 àïðåëÿ 2006 ã., 5:12:26:
> 
> > I have the following
> 
> > <resultmap id="allCategories" class="Category" >
> > <result property="categoryid" column="categoryid"
> />
> > <result property="prods"
> resultMap="mymap.products"/>
> > </resultMap>
> 
> > <resultMap id="mymap.products" class="Product" >
> > <result property="name" column="productname"/>
> > </resultMap>
> > <statement id="getAll" resultMap="allCategories">
> > ...
> > </statement>
> 
> > when i execute "getAll", category.getProds()
> returns
> > Collection of procuts. Is there any way I can get
> > category.getProds to return a HashMap ?
> > Thanks
> 
> 
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> > http://mail.yahoo.com 
> 
> 
> 
> ---------------------------------
> -- 
> Neverov Dm                        
> mailto:neverov_dg@nkmk.ru
> 
> 
> 
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Mime
View raw message