I just wanted to know how to map aggregation?
I did something like this
<bag name="ProductScales" table="tblProductScales" cascade="all"
lazy="false">
      <key column ="ID" />
      <many-to-many class="Scale" column="ScaleIDprimary" />
 </bag>
I have objects products and scales and product contains a collection
of scales, and i have a table ProductScales, but that table contains
one more column named StatusID and i dont know how to map Product,
that contains ProductScales... :(
This is my mapping for product:

<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
assembly="Objects" namespace="Objects">
  <class name="Product" table="tblProducts">
    <id name="ID" column ="ProductID" access="property">
      <generator class="native" />
    </id>
    <property name="Name" access="property" />
    <property name="ImagePath" column="Image" access="property"/>
    <property name="Description" access="property"/>
    <property name="Price" access="property"/>
    <property name="Brand" access="property"/>
    <property name="Gender" access="property"/>
    <property name="Usage" access="property"/>
    <bag name="ProductScales" table="tblProductScales" cascade="all"
lazy="false">
      <key column ="ID" />
      <many-to-many class="Scale" column="ScaleIDprimary" />
    </bag>
    <many-to-one name="Status"
                    class="Status"
                    column="StatusID"/>
  </class>
</hibernate-mapping>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to