forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContractVariationOneToManyJoin.hbm.xml
85 lines (79 loc) · 2.74 KB
/
ContractVariationOneToManyJoin.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?xml version="1.0"?>
<hibernate-mapping
xmlns="urn:nhibernate-mapping-2.2"
namespace="NHibernate.Test.Immutable.EntityWithMutableCollection"
assembly="NHibernate.Test">
<class name="Info" mutable="false">
<id name="Id">
<generator class="increment" />
</id>
<property name="Text" />
</class>
<class name="Plan" table="tbl_plan" mutable="false">
<id name="Id">
<generator class="increment" />
</id>
<property name="Description" not-null="true" />
<set name="Contracts" table="plan_contract" inverse="true" mutable="true" cascade="all" fetch="join">
<key column="col_plan" />
<many-to-many column="contract" class="Contract" />
</set>
<set name="Infos" inverse="true" mutable="true" cascade="all-delete-orphan">
<key column="col_plan" />
<one-to-many class="Info" />
</set>
</class>
<class name="Party" mutable="false">
<id name="Id">
<generator class="increment" />
</id>
<property name="Name" not-null="true" />
<set name="Infos" inverse="true" mutable="true" cascade="all-delete-orphan">
<key column="party" />
<one-to-many class="Info" />
</set>
<join table="contract_party" inverse="false" optional="true">
<key column="party" />
<many-to-one name="Contract" column="contract" not-null="true" />
</join>
</class>
<class name="Contract" mutable="false">
<id name="Id">
<generator class="increment" />
</id>
<property name="CustomerName" not-null="true" />
<property name="Type" not-null="true" />
<bag name="Variations" inverse="true" order-by="id asc" mutable="true" cascade="all-delete-orphan" fetch="join">
<key column="contract" />
<one-to-many class="ContractVariation" />
</bag>
<many-to-one name="Parent" />
<set name="Subcontracts" inverse="true" mutable="true" cascade="all" fetch="join">
<key column="parent" />
<one-to-many class="Contract" />
</set>
<set name="Plans" table="plan_contract" inverse="false" mutable="true" cascade="none">
<key column="contract" />
<many-to-many column="col_plan" class="Plan" />
</set>
<set name="Parties" table="contract_party" inverse="true" mutable="true" cascade="all">
<key column="contract" />
<many-to-many column="party" unique="true" class="Party" />
</set>
<set name="Infos" inverse="true" mutable="true" cascade="all-delete-orphan">
<key column="contract" />
<one-to-many class="Info" />
</set>
</class>
<class name="ContractVariation" mutable="false">
<id name="Id">
<generator class="increment" />
</id>
<property name="Text" type="StringClob" />
<many-to-one name="Contract" not-null="false" />
<set name="Infos" inverse="true" mutable="true" cascade="all-delete-orphan">
<key column="contractvariation" />
<one-to-many class="Info" />
</set>
</class>
</hibernate-mapping>