ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jane Phillips <jane22...@yahoo.com>
Subject Help needed to retrieve result class has ArrayList in its attributes.
Date Tue, 17 Jul 2007 17:46:18 GMT
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