Hello, I was wondering how you would write the mapping file for a one-to-many with a copmosite key.
I have the following mapping file... <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" > <class name="StaticData.Product, StaticData" table="v_Products" lazy="false"> <composite-id> <key-property name="Id" column="Id" type="string" ></key- property> <key-property name="MarketId" column="MarketId" type="string"></ key-property> </composite-id> <property name="Currency" column="CurrencyId" /> <property name="Description" column="Description" /> <property name="DisplayName" column="DisplayName" /> <bag name="SubProduct" table="tbl_SubProduct" lazy="false" order- by="Index" > <key column="Id" property-ref="Id"/> <one-to-many class="StaticData.SubProduct, StaticData"/> </bag> </class> <resultset name="AllProduct"> <return alias="Product" class="StaticData.Product, StaticData" /> </resultset> <sql-query name="GetProducts" resultset-ref="AllProduct" > exec p_GetProductsById :StoreId </sql-query> </hibernate-mapping>
How do you configure a composite key for bag. The config only allows key element not composite key for bag element.
thanks
|