Hibernate version:
2.0.1.4
Mapping documents:
<!-- Product -->
<class name="FlexiCommerce.Components.Product,FlexiCommerce" table="Flexi_Product">
<cache usage="read-write" />
<id name="ID" column="ID" type="Int32" unsaved-value="0" access="property">
<generator class="native" />
</id>
<bag name="Images" generic="true" lazy="true" table="Flexi_ProductImageMapping" cascade="none">
<cache usage="read-write" />
<key column="ProductID"></key>
<many-to-many class="FlexiCommerce.Components.Image,FlexiCommerce" column="ImageID"></many-to-many>
</bag>
</class>
<!-- Image -->
<class name="FlexiCommerce.Components.Image,FlexiCommerce" table="Flexi_Images">
<cache usage="read-write" />
<id name="ID" column="ID" type="Int32" unsaved-value="0" access="property">
<generator class="native" />
</id>
<property name="Bitmap" type="Serializable" length="2147483647" />
<property name="Hash" access="property"/>
</class>
Problem
I would like to add a sort number to the image field. Products may use the same pictures so I would like to keep the sort field relevant to the product-image mapping table.
Can I add images to the Product.Images property with a sort order property that will get saved to the mapping table rather than the image table?
|