forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathParentChild.hbm.xml
32 lines (29 loc) · 975 Bytes
/
ParentChild.hbm.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
assembly="NHibernate.Test"
namespace="NHibernate.Test.SubselectFetchTest">
<class name="Child">
<id name="Name" unsaved-value="any">
<generator class="assigned" />
</id>
<bag name="Friends" fetch="subselect" table="ChildChild">
<key column="childName1" not-null="true" />
<many-to-many class="Child" column="childName2"/>
</bag>
</class>
<class name="Parent">
<id name="Name" unsaved-value="any">
<generator class="assigned" />
</id>
<list name="Children" fetch="subselect" cascade="all">
<key column="parentName" not-null="true"/>
<index column="loc"/>
<one-to-many class="Child"/>
</list>
<list name="MoreChildren" table="ParentChild" fetch="subselect">
<key column="parentName" not-null="true"/>
<index column="loc"/>
<many-to-many class="Child" column="childName"/>
</list>
</class>
</hibernate-mapping>