Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Map supplier-orders model with <set>
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="NHTests" namespace="NHTests">
<class name="Supplier" table="Suppliers">
<id name="Id">
<generator class="guid" />
</id>
<property name="Name" length="100" />
<set name="Orders" cascade="all-delete-orphan" inverse="true" >
<key column="SupplierId" />
<one-to-many class="SupplierOrder" />
</set>
</class>
<class name="SupplierOrder" table="SupplierOrders" >
<id name="Id">
<generator class="guid" />
</id>
<many-to-one name="Supplier" class="Supplier" column="SupplierId" />
<property name="OrderTime" />
</class>
</hibernate-mapping>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment