ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jozef Hribik <jozef.hri...@apsoft.sk>
Subject [Fwd: How to pass a parameter to collection property?]
Date Fri, 02 Dec 2005 06:38:51 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
  <title></title>
</head>
<body style="color: rgb(0, 0, 0); font-family: Arial;" bgcolor="#ffffff"
 text="#000000">
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
<title></title>
I would like to pass an additional parameter to filter a collection
property.<br>
I will use an example from iBATIS-SqlMaps-2.pdf, page 27.<br>
 <br>
How can i select a category with products with certain price specified
by parameterX?<br>
 <br>
&lt;resultMap id=”get-category-result”
class=”com.ibatis.example.Category”&gt;<br>
&lt;result property=”id” column=”CAT_ID”/&gt;<br>
&lt;result property=”description” column=”CAT_DESCRIPTION”/&gt;<br>
&lt;result property=”productList” column=”CAT_ID”
select=”getProductsByCatId”/&gt;<br>
&lt;/resultMap&gt;<br>
<br>
&lt;statement id=”getProductsByCatId” parameterClass=”int”
resultMap=”get-product-result”&gt;<br>
select * from PRODUCT where PRD_CAT_ID = #value# and PRD_PRICE = <b>#parameterX#</b><br>
&lt;/statement&gt;<br>
<br>
Thanks<br>
Jozef<br>
</body>
</html>

Mime
View raw message