Hi friends,
I have mapped the Order class which also includes collection of products.
within same mapping file I also have mapped products as idbag.
My requirement is that when I am retrieveing order the product's ids (primary keys) are not getting available.
Part of Mapping documents:
Code:
<idbag name="products" table="products">
<collection-id type="long" column="PRODUCT_ID">
<generator class="increment">
</generator>
</collection-id>
<key column="ORDER_ID" not-null="true"></key>
<composite-element class="com.raisonne.billsmart.GeneralPOs.JobPO">
<property name="productName" column="PRODUCTNAME" type="java.lang.String"/>
I need the value of "PRODUCT_ID" field for each product object in variable "productId".
Any guidance regarding this issue is highly appriciated.