I would like to pass an additional parameter to filter a collection property.
I will use an example from iBATIS-SqlMaps-2.pdf, page 27.
 
How can i select a category with products with certain price specified by parameterX?
 
<resultMap id=”get-category-result” class=”com.ibatis.example.Category”>
<result property=”id” column=”CAT_ID”/>
<result property=”description” column=”CAT_DESCRIPTION”/>
<result property=”productList” column=”CAT_ID” select=”getProductsByCatId”/>
</resultMap>

<statement id=”getProductsByCatId” parameterClass=”int” resultMap=”get-product-result”>
select * from PRODUCT where PRD_CAT_ID = #value# and PRD_PRICE = #parameterX#
</statement>

Thanks
Jozef

Reply via email to