forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBaz.hbm.xml
384 lines (357 loc) · 8.25 KB
/
Baz.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
<?xml version="1.0"?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-lazy="false"
assembly="NHibernate.DomainModel"
namespace="NHibernate.DomainModel">
<class
name="Baz"
table="`baz baz baz`"
>
<id
name="Code"
type="String"
>
<column
name="baz_id"
length="32"
/>
<generator class="uuid.hex"/>
</id>
<property
name="Count"
column="count_count"
type="Int32"
/>
<property
name="Name"
column="name_b"
/>
<many-to-one
name="Foo"
outer-join="true"
class="Foo"
/>
<list
name="StringList"
table="string_list"
batch-size="3"
>
<key>
<column
name="id"
length="16"
/>
</key>
<index column="`i`"/>
<element
column="element"
type="String"
/>
</list>
<primitive-array
name="IntArray"
table="int_array"
>
<key>
<column
name="id"
length="16"
/>
</key>
<index column="i"/>
<element
column="j"
type="Int32"
/>
</primitive-array>
<set
name="FooSet"
lazy="true"
order-by="string_"
batch-size="3"
>
<key>
<column
name="baz_id"
length="16"
/>
</key>
<one-to-many
class="Foo"
/>
</set>
<array
name="Components"
table="bazcomponents"
>
<key>
<column
name="baz_id"
length="16"
/>
</key>
<index column="i"/>
<composite-element
class="FooComponent"
>
<parent name="Baz"/>
<property name="Name">
<column
name="name"
length="56"
/>
</property>
<property
name="Count"
column="count_"
type="Int32"
/>
<nested-composite-element
name="Subcomponent"
class="FooComponent"
>
<property name="Name" column="x_"/>
<property name="Count" column="y_" type="Int32"/>
</nested-composite-element>
</composite-element>
</array>
<array name="TimeArray">
<key>
<column name="baz_id" length="16"/>
</key>
<index column="j"/>
<element column="the_time" type="time"/>
</array>
<bag
name="Bag"
order-by="`name!`"
table="`$%^^b a g`"
>
<key>
<column
name="`baz_id@#$`"
length="16"
/>
</key>
<element
column="`name!`"
type="String"
/>
</bag>
<map name="FooToGlarch">
<key>
<column
name="baz_id"
length="16"
/>
</key>
<index-many-to-many
column="foo_id"
class="Foo"
/>
<many-to-many
column="glarch_id"
class="Glarch"
/>
</map>
<map name="FooComponentToFoo">
<!--<cache usage="read-write"/>-->
<key>
<column
name="baz_id"
length="16"
/>
</key>
<composite-index
class="FooComponent"
>
<key-property
name="Name"
length="32"
/>
<key-property
name="Count"
column="count_"
type="Int32"
/>
</composite-index>
<many-to-many
column="foo_id"
class="Foo"
outer-join="true"
/>
</map>
<map name="GlarchToFoo">
<key>
<column name="gtf_baz_id" length="16"/>
</key>
<index-many-to-many column="gtf_foo_id" class="Foo"/>
<one-to-many class="Glarch"/>
</map>
<set
name="StringSet"
lazy="true"
sort="StringComparator"
batch-size="3"
>
<key column="id_"/>
<element column="element" type="String" not-null="true" length="32"/>
</set>
<map name="StringDateMap" lazy="true" sort="ReverseComparator" collection-type="sorted-list">
<key column="id_"/>
<index column="map_key" type="String" length="32"/>
<element column="map_value" type="DateTime" />
</map>
<array name="FooArray" element-class="FooProxy" where="i<8">
<!--<cache usage="read-write"/>-->
<key column="id_"/>
<index column="i"/>
<many-to-many class="Foo" fetch="select">
<column name="foo" length="36"/>
</many-to-many>
</array>
<bag name="FooBag" lazy="true" table="baz_foo" cascade="all-delete-orphan" inverse="false">
<key column="baz"/>
<many-to-many class="Foo" column="foo" outer-join="true"/>
</bag>
<idbag name="IdFooBag" lazy="true" table="baz_id_foo" cascade="all">
<collection-id column="pkid" type="Int64">
<generator class="hilo"/>
</collection-id>
<key column="baz"/>
<many-to-many class="Foo" column="foo" outer-join="true"/>
</idbag>
<idbag name="ByteBag" lazy="true" table="baz_byte_bag" cascade="all">
<collection-id column="pkid" type="Int64">
<generator class="hilo"/>
</collection-id>
<key column="baz"/>
<element type="Byte[]" column="bytez" not-null="true"/>
</idbag>
<array name="StringArray">
<key column="id_"/>
<index column="i"/>
<element column="name" type="String"/>
</array>
<list name="Fees" lazy="true" cascade="all">
<key column="bazid"/>
<index column="bazind"/>
<one-to-many class="Fee"/>
</list>
<list name="Customs">
<key column="id_"/>
<index column="indx"/>
<element type="NHibernate.DomainModel.DoubleStringType, NHibernate.DomainModel">
<column name="first_"/>
<column name="second_"/>
</element>
</list>
<list name="TopComponents" table="topcomponents">
<!--<cache usage="read-write"/>-->
<key column="id_"/>
<index column="i"/>
<composite-element class="FooComponent">
<property name="Name"/>
<property name="Count" column="count_" type="Int32"/>
</composite-element>
</list>
<set name="TopFoos">
<key column="idtopbar" />
<one-to-many class = "Bar"/>
</set>
<set name="CascadingBars" cascade="all-delete-orphan">
<key column="idofbaz" />
<one-to-many class = "Bar"/>
</set>
<map name="TopGlarchez">
<key column="idtopglarch" />
<index column="mapkey" type="Char" length="1"/>
<!--
added length for NH because a Char does not have a direct DbType.Char but instead
uses DbType.String so it defaults to 255 if 1 is not found.
-->
<one-to-many class = "Glarch"/>
</map>
<set name="Cached" sort="natural" table="cached_set">
<!--<cache usage="read-write"/>-->
<key column="baz"/>
<composite-element class="CompositeElement">
<property name="Foo"/>
<property name="Bar"/>
</composite-element>
</set>
<map name="CachedMap" sort="natural" table="cached_map" collection-type="sorted-list">
<!--<cache usage="read-write"/>-->
<key column="baz"/>
<index-many-to-many column="another_baz" class="Baz"/>
<composite-element class="CompositeElement">
<property name="Foo"/>
<property name="Bar"/>
</composite-element>
</map>
<map name="StringGlarchMap" where="baz_map_index > 'a' and tha_key is not null" cascade="all">
<key column="baz_map_id"/>
<index column="baz_map_index" type="String"/>
<one-to-many class="Glarch"/>
</map>
<map name="AnyToAny" lazy="true">
<key column="baz"/>
<index-many-to-any id-type="Int64">
<column name="ind_clazz_"/>
<column name="ind_id_"/>
</index-many-to-any>
<many-to-any id-type="Int64">
<column name="el_clazz_"/>
<column name="el_id_"/>
</many-to-any>
</map>
<list name="ManyToAny" lazy="true">
<key column="baz"/>
<index column="ind"/>
<many-to-any id-type="string">
<column name="el_clazz_"/>
<column name="el_id_"/>
</many-to-any>
</list>
<bag name="Bazez" lazy="true" order-by="name_b desc" cascade="all">
<key column="`baz id`"/>
<one-to-many class="Baz"/>
</bag>
<set name="Sortablez" sort="natural" cascade="all">
<key column="baz"/>
<one-to-many class="Sortable"/>
</set>
<bag name="Parts" lazy="true" cascade="save-update">
<key column="baz"/>
<one-to-many class="Part"/>
</bag>
<component name="CollectionComponent">
<component name="Nested">
<property name="Str"/>
<bag name="Foos" cascade="all">
<key column="baz_compon_id"/>
<one-to-many class="Foo"/>
</bag>
<bag name="Floats" table="baz_floats_bag">
<key column="baz_compon_id"/>
<!-- TODO: fix this to a Single -->
<element type="Int64" column="float_value"/>
</bag>
</component>
</component>
</class>
<class name="Sortable">
<id name="id" unsaved-value="0">
<generator class="native"/>
</id>
<property name="name"/>
</class>
<class name="Part"
where="Description like 'x%'">
<id name="Id" unsaved-value="0">
<generator class="native"/>
</id>
<discriminator column="clazz"/>
<property name="Description"/>
<subclass name="Part+SpecialPart" />
</class>
</hibernate-mapping>