If I'm inferring correctly from the info you've provided, I believe
you want to be able to select CatalogLines based on UserId and
CatagoryId?
You can assign composite keys in the Column attribute (see section
3.5.14 of the documentation) using comma separated values of
"param=column".
So instead of:
<result property="xCatalogLines" column="ID" select="GetLines"
lazyLoad="true" />
You can use:
<result property="xCatalogLines" column="catalogID=ID, userID=UserID"
select="GetLines" lazyLoad="true" />
select * FROM CatalogLines WHERE CatalogID = #catalogId# AND UserID = #userId#
On 2/27/07, Kenneth Olsen <[EMAIL PROTECTED]> wrote:
Hi
<resultMaps>
<resultMap id="resCatalog" class="Catalog">
<result property="xID" column="ID" />
<result property="xName" column="Name"/>
<result property="xCatalogLines" column="ID" select="GetLines"
lazyLoad="true" />
</resultMap>
<select id="GetAll" resultMap="resCatalog"
ParameterClass="System.Collections.IDictionary">
SELECT *
FROM
Catalog
WHERE
UserID = #UserID#
</select>
---
<select id="GetLines " resultMap="resCatalogLine">
select * FROM CatalogLines WHERE ???
Can the ParameterClass of 'GetAll' (System.Collections.IDictionary) select
statement, be passed to the GetLines statement? I need a value from the
System.Collections.IDictionary in the GetLines statement, where I placed the
three ?.
--
Kenneth Olsen