-
-
Save stanb/e5ade12f089a70a6bc11 to your computer and use it in GitHub Desktop.
Mapping bidirectional association sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="NHTests" namespace="NHTests"> | |
<class name="Order" table="Orders"> | |
<id name="Id"> | |
<generator class="guid" /> | |
</id> | |
<version name="Version" /> | |
<property name="OrderTime" /> | |
<bag name="OrderLines" cascade="all-delete-orphan" inverse="true" > | |
<key column="OrderId" /> | |
<one-to-many class="OrderLine" /> | |
</bag> | |
</class> | |
<class name="OrderLine" table="OrderLines" > | |
<id name="Id"> | |
<generator class="guid" /> | |
</id> | |
<many-to-one name="Order" class="Order" column="OrderId" /> | |
<property name="ProductName" /> | |
<property name="Price" /> | |
<property name="Quantity" /> | |
</class> | |
</hibernate-mapping> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment