forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBaz.cs
454 lines (400 loc) · 9.85 KB
/
Baz.cs
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
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
using System;
using System.Collections;
using System.Collections.Generic;
using Iesi.Collections.Generic;
using System.Linq;
namespace NHibernate.DomainModel
{
[Serializable]
public class Baz : INamed, IComparable
{
#region Fields
private NestingComponent _collectionComponent;
private String _code;
private FooComponent[] _components;
private DateTime[] _timeArray;
private string[] _stringArray;
private int[] _intArray;
private FooProxy[] _fooArray;
private Int32 _count;
private String _name;
private Foo _foo;
private IList<string> _stringList;
private IList<Fee> _fees;
private IList<string[]> _customs;
private IList<FooComponent> _topComponents;
private IDictionary<Foo, GlarchProxy> _fooToGlarch;
private IDictionary<FooComponent, Foo> _fooComponentToFoo;
private IDictionary<Foo, GlarchProxy> _glarchToFoo;
private IDictionary<string, DateTime?> _stringDateMap;
private IDictionary<char, GlarchProxy> _topGlarchez;
private IDictionary<Baz, CompositeElement> _cachedMap;
private IDictionary<string, Glarch> _stringGlarchMap;
private IDictionary<object, object> _anyToAny;
private IList<object> _manyToAny;
private ISet<FooProxy> _fooSet;
private ISet<string> _stringSet;
private ISet<Bar> _topFoos;
private ISet<BarProxy> _cascadingBars;
private ISet<CompositeElement> _cached;
private ISet<Sortable> _sortablez;
private IList<string> _bag;
private IList<Foo> _fooBag;
private IList<Foo> _idFooBag;
private IList<byte[]> _byteBag;
private IList<Baz> _bazez;
private IList<Part> _parts;
#endregion
#region Constructors
/// <summary>
/// Default constructor for class Baz
/// </summary>
public Baz()
{
}
#endregion
#region Properties
/// <summary>
/// Gets or sets the _collectionComponent
/// </summary>
public NestingComponent CollectionComponent
{
get { return _collectionComponent; }
set { _collectionComponent = value; }
}
/// <summary>
/// Get/set for Code
/// </summary>
public String Code
{
get { return this._code; }
set { this._code = value; }
}
/// <summary>
/// Get/set for count
/// </summary>
public Int32 Count
{
get { return this._count; }
set { this._count = value; }
}
/// <summary>
/// Get/set for name
/// </summary>
public String Name
{
get { return this._name; }
set { this._name = value; }
}
/// <summary>
/// Get/set for Foo
/// </summary>
public Foo Foo
{
get { return this._foo; }
set { this._foo = value; }
}
/// <summary>
/// Get/set for stringList
/// </summary>
public IList<string> StringList
{
get { return this._stringList; }
set { this._stringList = value; }
}
/// <summary>
/// Get/set for fees
/// </summary>
public IList<Fee> Fees
{
get { return _fees; }
set { _fees = value; }
}
/// <summary>
/// Get/set for customs
/// </summary>
public IList<string[]> Customs
{
get { return this._customs; }
set { this._customs = value; }
}
/// <summary>
/// Get/set for topComponents
/// </summary>
public IList<FooComponent> TopComponents
{
get { return this._topComponents; }
set { this._topComponents = value; }
}
/// <summary>
/// Get/set for fooToGlarch
/// </summary>
public IDictionary<Foo, GlarchProxy> FooToGlarch
{
get { return this._fooToGlarch; }
set { this._fooToGlarch = value; }
}
/// <summary>
/// Get/set for fooComponentToFoo
/// </summary>
public IDictionary<FooComponent, Foo> FooComponentToFoo
{
get { return this._fooComponentToFoo; }
set { this._fooComponentToFoo = value; }
}
/// <summary>
/// Get/set for glarchToFoo
/// </summary>
public IDictionary<Foo, GlarchProxy> GlarchToFoo
{
get { return this._glarchToFoo; }
set { this._glarchToFoo = value; }
}
/// <summary>
/// Get/set for stringDateMap
/// </summary>
public IDictionary<string, DateTime?> StringDateMap
{
get { return this._stringDateMap; }
set { this._stringDateMap = value; }
}
/// <summary>
/// Get/set for topGlarchez
/// </summary>
public IDictionary<char, GlarchProxy> TopGlarchez
{
get { return this._topGlarchez; }
set { this._topGlarchez = value; }
}
/// <summary>
/// Get/set for cachedMap
/// </summary>
public IDictionary<Baz,CompositeElement> CachedMap
{
get { return this._cachedMap; }
set { this._cachedMap = value; }
}
/// <summary>
/// Get/set for stringGlarchMap
/// </summary>
public IDictionary<string, Glarch> StringGlarchMap
{
get { return this._stringGlarchMap; }
set { this._stringGlarchMap = value; }
}
/// <summary>
/// Get/set for anyToAny
/// </summary>
public IDictionary<object, object> AnyToAny
{
get { return this._anyToAny; }
set { this._anyToAny = value; }
}
/// <summary>
/// Get/set for manyToAny
/// </summary>
public IList<object> ManyToAny
{
get { return this._manyToAny; }
set { this._manyToAny = value; }
}
/// <summary>
/// Gets or sets the intArray
/// </summary>
public int[] IntArray
{
get { return _intArray; }
set { _intArray = value; }
}
/// <summary>
/// Gets or sets the _components
/// </summary>
public FooComponent[] Components
{
get { return _components; }
set { _components = value; }
}
/// <summary>
/// Gets or sets the timeArray
/// </summary>
public DateTime[] TimeArray
{
get { return _timeArray; }
set { _timeArray = value; }
}
/// <summary>
/// Gets or sets the stringArray
/// </summary>
public string[] StringArray
{
get { return _stringArray; }
set { _stringArray = value; }
}
/// <summary>
/// Gets or sets the fooArray
/// </summary>
public FooProxy[] FooArray
{
get { return _fooArray; }
set { _fooArray = value; }
}
/// <summary>
/// Get/set for fooSet
/// </summary>
public ISet<FooProxy> FooSet
{
get { return this._fooSet; }
set { this._fooSet = value; }
}
/// <summary>
/// Get/set for stringSet
/// </summary>
public ISet<string> StringSet
{
get { return this._stringSet; }
set { this._stringSet = value; }
}
/// <summary>
/// Get/set for topFoos
/// </summary>
public ISet<Bar> TopFoos
{
get { return this._topFoos; }
set { this._topFoos = value; }
}
/// <summary>
/// Get/set for cascadingBars
/// </summary>
public ISet<BarProxy> CascadingBars
{
get { return this._cascadingBars; }
set { this._cascadingBars = value; }
}
/// <summary>
/// Get/set for cached
/// </summary>
public ISet<CompositeElement> Cached
{
get { return this._cached; }
set { this._cached = value; }
}
/// <summary>
/// Get/set for sortablez
/// </summary>
public ISet<Sortable> Sortablez
{
get { return this._sortablez; }
set { this._sortablez = value; }
}
/// <summary>
/// Get/set for bag
/// </summary>
public IList<string> Bag
{
get { return this._bag; }
set { this._bag = value; }
}
/// <summary>
/// Get/set for fooBag
/// </summary>
public IList<Foo> FooBag
{
get { return this._fooBag; }
set { this._fooBag = value; }
}
/// <summary>
/// Get/set for bazez
/// </summary>
public IList<Baz> Bazez
{
get { return this._bazez; }
set { this._bazez = value; }
}
/// <summary>
/// Get/set for idFooBag
/// </summary>
public IList<Foo> IdFooBag
{
get { return this._idFooBag; }
set { this._idFooBag = value; }
}
/// <summary>
/// Get/set for byteBag
/// </summary>
public IList<byte[]> ByteBag
{
get { return this._byteBag; }
set { this._byteBag = value; }
}
/// <summary>
/// Get/set for parts
/// </summary>
public IList<Part> Parts
{
get { return this._parts; }
set { this._parts = value; }
}
#endregion
public void SetDefaults()
{
DateTime today = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
StringSet = new HashSet<string> {"foo", "bar", "baz"};
StringDateMap = new SortedList<string, DateTime?>();
StringDateMap.Add("now", DateTime.Now);
StringDateMap.Add("never", null); // value is persisted since NH-2199
// according to SQL Server the big bag happened in 1753 ;)
StringDateMap.Add("big bang", new DateTime(1753, 01, 01));
//StringDateMap.Add( "millenium", new DateTime( 2000, 01, 01 ) );
StringArray = StringSet.ToArray();
StringList = new List<string>(StringArray);
IntArray = new int[] {1, 3, 3, 7};
FooArray = Array.Empty<Foo>();
Customs = new List<string[]>();
Customs.Add(new String[] {"foo", "bar"});
Customs.Add(new String[] {"A", "B"});
Customs.Add(new String[] {"1", "2"});
FooSet = new HashSet<FooProxy>();
Components = new FooComponent[]
{
new FooComponent("foo", 42, null, null),
new FooComponent("bar", 88, null, new FooComponent("sub", 69, null, null))
};
TimeArray = new DateTime[]
{
new DateTime(),
new DateTime(),
new DateTime(), // H2.1 has null here, but it's illegal on .NET
new DateTime(0)
};
Count = 667;
Name = "Bazza";
TopComponents = new List<FooComponent>();
TopComponents.Add(new FooComponent("foo", 11, new DateTime[] {today, new DateTime(2123, 1, 1)}, null));
TopComponents.Add(
new FooComponent("bar", 22, new DateTime[] {new DateTime(2007, 2, 3), new DateTime(1945, 6, 1)}, null));
TopComponents.Add(null);
Bag = new List<string>();
Bag.Add("duplicate");
Bag.Add("duplicate");
Bag.Add("duplicate");
Bag.Add("unique");
Cached = new LinkedHashSet<CompositeElement>();
CompositeElement ce = new CompositeElement();
ce.Foo = "foo";
ce.Bar = "bar";
CompositeElement ce2 = new CompositeElement();
ce2.Foo = "fooxxx";
ce2.Bar = "barxxx";
Cached.Add(ce);
Cached.Add(ce2);
CachedMap = new SortedList<Baz, CompositeElement>();
CachedMap.Add(this, ce);
}
#region IComparable Members
public int CompareTo(object obj)
{
return ((Baz) obj).Code.CompareTo(Code);
}
#endregion
}
}