ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Maves" <nathan.ma...@gmail.com>
Subject Re: Help needed to retrieve result class has ArrayList in its attributes.
Date Tue, 17 Jul 2007 21:45:55 GMT
I think you are looking for the complex properties functionality on
page 36 of the developers manual.

Nathan



On 7/17/07, Jane Phillips <jane22124@yahoo.com> wrote:
> Hello,
>
> I need help to retrieve a query which one ID(product) assoicated many other
> info(client names etc). The lay out as followings:
>
> table 1 : products
> column 1) productID
> column 2) name
> column 3) desc
>
> table 2: product_Client. in this table one product ID can have multiple
> clientnames.
> column 1) productID
> column 2) clientname
>
> java: ProductOBJ
> String productID;
> String name;
> String desc
> ArrayList clientname;
>
> <sqlMap>
> <select id="getProducts" parameterClass="java.lang.String"
> resultClass="ProductOBJ">
> select a.productID, a.name,b.clientname
> from products a, product_client b
> where a.productID = b.productID
> and a.productID=xxx
> </select>
> </sqlMap>
>
> I would like to have query return me as one ProductOBJ has many client
> name(String). I am using ProductOBJ aProduct =
> (ProductOBJ)queryForObject("getProducts", productID)
>
> Thanks so much,
>
>  ________________________________
> Sucker-punch spam with award-winning protection.
>  Try the free Yahoo! Mail Beta.
>
>

Mime
View raw message