ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clinton Begin <clinton.be...@gmail.com>
Subject Re: Array properties in result object
Date Mon, 10 Jan 2005 04:43:48 GMT
Yeah, that should work.

Try it and let us know.  ;-)

Clinton


On Fri, 7 Jan 2005 12:39:04 +0100, Levin, Alexander <ale@norcom.de> wrote:
> Hello,
> 
> is it possible to populate an array property from a mapped statement? Like
> this (to stick with the example from the manual):
> 
> class Category {
>   ...
>   private Product[] products;
>   public void setProducts(Product[] products) {...}
> }
> 
> class Product {...}
> 
> <resultMap id="get-category-result" class="com.ibatis.example.Category">
>   ...
>   <result property="products" column="CAT_ID" select="getProductsByCatId"/>
> </resultMap>
> 
> Now I want to have a statement that would return a Category. The manual
> (page 26) says that only Collection (and List -- which is also a Collection)
> is supported but I've heard that iBatis 2.0 also supports arrays.
> 
> Ok, I could have another setter with a Collection parameter and call toArray
> there but is it possible directly?
> 
> Many thanks in advance
> 
> Alex
>

Mime
View raw message