Skip to content

Commit 889f6df

Browse files
committed
Merge branch 'NH-3345'
2 parents ef1c05c + 600c5b5 commit 889f6df

File tree

152 files changed

+3395
-4652
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+3395
-4652
lines changed

src/NHibernate.DomainModel/Assignable.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System;
2-
using System.Collections;
3-
2+
using System.Collections.Generic;
3+
44
namespace NHibernate.DomainModel
55
{
66
/// <summary>
@@ -9,15 +9,15 @@ namespace NHibernate.DomainModel
99
public class Assignable
1010
{
1111
private string _id;
12-
private IList _categories;
12+
private IList<Category> _categories;
1313

1414
public string Id
1515
{
1616
get { return _id; }
1717
set { _id = value; }
1818
}
1919

20-
public IList Categories
20+
public IList<Category> Categories
2121
{
2222
get { return _categories; }
2323
set { _categories = value; }

src/NHibernate.DomainModel/B.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using System;
2-
using System.Collections;
2+
using System.Collections.Generic;
33

44
namespace NHibernate.DomainModel
55
{
@@ -22,7 +22,7 @@ public class B : A
2222
/// <summary>
2323
/// Holder for map
2424
/// </summary>
25-
private IDictionary _map;
25+
private IDictionary<string, string> _map;
2626

2727
#endregion
2828

@@ -41,7 +41,7 @@ public B()
4141
/// <param name="name">Initial name value</param>
4242
/// <param name="count">Initial count value</param>
4343
/// <param name="map">Initial map value</param>
44-
public B(String name, Int32 count, IDictionary map)
44+
public B(String name, Int32 count, IDictionary<string, string> map)
4545
: base(name)
4646
{
4747
this._count = count;
@@ -52,7 +52,7 @@ public B(String name, Int32 count, IDictionary map)
5252
/// Minimal constructor for class B
5353
/// </summary>
5454
/// <param name="map">Initial map value</param>
55-
public B(IDictionary map)
55+
public B(IDictionary<string, string> map)
5656
{
5757
this._map = map;
5858
}
@@ -73,7 +73,7 @@ public virtual Int32 Count
7373
/// <summary>
7474
/// Get/set for map
7575
/// </summary>
76-
public virtual IDictionary Map
76+
public virtual IDictionary<string, string> Map
7777
{
7878
get { return _map; }
7979
set { _map = value; }

src/NHibernate.DomainModel/Baz.cs

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -21,31 +21,31 @@ public class Baz : INamed, IComparable
2121
private Int32 _count;
2222
private String _name;
2323
private Foo _foo;
24-
private IList _stringList;
25-
private IList _fees;
26-
private IList _customs;
27-
private IList _topComponents;
28-
private IDictionary _fooToGlarch;
29-
private IDictionary _fooComponentToFoo;
30-
private IDictionary _glarchToFoo;
31-
private IDictionary _stringDateMap;
32-
private IDictionary _topGlarchez;
33-
private IDictionary _cachedMap;
34-
private IDictionary _stringGlarchMap;
35-
private IDictionary _anyToAny;
36-
private IList _manyToAny;
24+
private IList<string> _stringList;
25+
private IList<Fee> _fees;
26+
private IList<string[]> _customs;
27+
private IList<FooComponent> _topComponents;
28+
private IDictionary<Foo, GlarchProxy> _fooToGlarch;
29+
private IDictionary<FooComponent, Foo> _fooComponentToFoo;
30+
private IDictionary<Foo, GlarchProxy> _glarchToFoo;
31+
private IDictionary<string, DateTime?> _stringDateMap;
32+
private IDictionary<char, GlarchProxy> _topGlarchez;
33+
private IDictionary<Baz, CompositeElement> _cachedMap;
34+
private IDictionary<string, Glarch> _stringGlarchMap;
35+
private IDictionary<object, object> _anyToAny;
36+
private IList<object> _manyToAny;
3737
private ISet<FooProxy> _fooSet;
3838
private ISet<string> _stringSet;
3939
private ISet<Bar> _topFoos;
4040
private ISet<BarProxy> _cascadingBars;
4141
private ISet<CompositeElement> _cached;
4242
private ISet<Sortable> _sortablez;
43-
private IList _bag;
44-
private IList _fooBag;
45-
private IList _idFooBag;
46-
private IList _byteBag;
47-
private IList _bazez;
48-
private IList _parts;
43+
private IList<string> _bag;
44+
private IList<Foo> _fooBag;
45+
private IList<Foo> _idFooBag;
46+
private IList<byte[]> _byteBag;
47+
private IList<Baz> _bazez;
48+
private IList<Part> _parts;
4949

5050
#endregion
5151

@@ -110,7 +110,7 @@ public Foo Foo
110110
/// <summary>
111111
/// Get/set for stringList
112112
/// </summary>
113-
public IList StringList
113+
public IList<string> StringList
114114
{
115115
get { return this._stringList; }
116116
set { this._stringList = value; }
@@ -119,7 +119,7 @@ public IList StringList
119119
/// <summary>
120120
/// Get/set for fees
121121
/// </summary>
122-
public IList Fees
122+
public IList<Fee> Fees
123123
{
124124
get { return _fees; }
125125
set { _fees = value; }
@@ -128,7 +128,7 @@ public IList Fees
128128
/// <summary>
129129
/// Get/set for customs
130130
/// </summary>
131-
public IList Customs
131+
public IList<string[]> Customs
132132
{
133133
get { return this._customs; }
134134
set { this._customs = value; }
@@ -137,7 +137,7 @@ public IList Customs
137137
/// <summary>
138138
/// Get/set for topComponents
139139
/// </summary>
140-
public IList TopComponents
140+
public IList<FooComponent> TopComponents
141141
{
142142
get { return this._topComponents; }
143143
set { this._topComponents = value; }
@@ -146,7 +146,7 @@ public IList TopComponents
146146
/// <summary>
147147
/// Get/set for fooToGlarch
148148
/// </summary>
149-
public IDictionary FooToGlarch
149+
public IDictionary<Foo, GlarchProxy> FooToGlarch
150150
{
151151
get { return this._fooToGlarch; }
152152
set { this._fooToGlarch = value; }
@@ -155,7 +155,7 @@ public IDictionary FooToGlarch
155155
/// <summary>
156156
/// Get/set for fooComponentToFoo
157157
/// </summary>
158-
public IDictionary FooComponentToFoo
158+
public IDictionary<FooComponent, Foo> FooComponentToFoo
159159
{
160160
get { return this._fooComponentToFoo; }
161161
set { this._fooComponentToFoo = value; }
@@ -164,7 +164,7 @@ public IDictionary FooComponentToFoo
164164
/// <summary>
165165
/// Get/set for glarchToFoo
166166
/// </summary>
167-
public IDictionary GlarchToFoo
167+
public IDictionary<Foo, GlarchProxy> GlarchToFoo
168168
{
169169
get { return this._glarchToFoo; }
170170
set { this._glarchToFoo = value; }
@@ -173,7 +173,7 @@ public IDictionary GlarchToFoo
173173
/// <summary>
174174
/// Get/set for stringDateMap
175175
/// </summary>
176-
public IDictionary StringDateMap
176+
public IDictionary<string, DateTime?> StringDateMap
177177
{
178178
get { return this._stringDateMap; }
179179
set { this._stringDateMap = value; }
@@ -182,7 +182,7 @@ public IDictionary StringDateMap
182182
/// <summary>
183183
/// Get/set for topGlarchez
184184
/// </summary>
185-
public IDictionary TopGlarchez
185+
public IDictionary<char, GlarchProxy> TopGlarchez
186186
{
187187
get { return this._topGlarchez; }
188188
set { this._topGlarchez = value; }
@@ -191,7 +191,7 @@ public IDictionary TopGlarchez
191191
/// <summary>
192192
/// Get/set for cachedMap
193193
/// </summary>
194-
public IDictionary CachedMap
194+
public IDictionary<Baz,CompositeElement> CachedMap
195195
{
196196
get { return this._cachedMap; }
197197
set { this._cachedMap = value; }
@@ -200,7 +200,7 @@ public IDictionary CachedMap
200200
/// <summary>
201201
/// Get/set for stringGlarchMap
202202
/// </summary>
203-
public IDictionary StringGlarchMap
203+
public IDictionary<string, Glarch> StringGlarchMap
204204
{
205205
get { return this._stringGlarchMap; }
206206
set { this._stringGlarchMap = value; }
@@ -209,7 +209,7 @@ public IDictionary StringGlarchMap
209209
/// <summary>
210210
/// Get/set for anyToAny
211211
/// </summary>
212-
public IDictionary AnyToAny
212+
public IDictionary<object, object> AnyToAny
213213
{
214214
get { return this._anyToAny; }
215215
set { this._anyToAny = value; }
@@ -218,7 +218,7 @@ public IDictionary AnyToAny
218218
/// <summary>
219219
/// Get/set for manyToAny
220220
/// </summary>
221-
public IList ManyToAny
221+
public IList<object> ManyToAny
222222
{
223223
get { return this._manyToAny; }
224224
set { this._manyToAny = value; }
@@ -328,7 +328,7 @@ public ISet<Sortable> Sortablez
328328
/// <summary>
329329
/// Get/set for bag
330330
/// </summary>
331-
public IList Bag
331+
public IList<string> Bag
332332
{
333333
get { return this._bag; }
334334
set { this._bag = value; }
@@ -337,7 +337,7 @@ public IList Bag
337337
/// <summary>
338338
/// Get/set for fooBag
339339
/// </summary>
340-
public IList FooBag
340+
public IList<Foo> FooBag
341341
{
342342
get { return this._fooBag; }
343343
set { this._fooBag = value; }
@@ -346,7 +346,7 @@ public IList FooBag
346346
/// <summary>
347347
/// Get/set for bazez
348348
/// </summary>
349-
public IList Bazez
349+
public IList<Baz> Bazez
350350
{
351351
get { return this._bazez; }
352352
set { this._bazez = value; }
@@ -355,7 +355,7 @@ public IList Bazez
355355
/// <summary>
356356
/// Get/set for idFooBag
357357
/// </summary>
358-
public IList IdFooBag
358+
public IList<Foo> IdFooBag
359359
{
360360
get { return this._idFooBag; }
361361
set { this._idFooBag = value; }
@@ -364,7 +364,7 @@ public IList IdFooBag
364364
/// <summary>
365365
/// Get/set for byteBag
366366
/// </summary>
367-
public IList ByteBag
367+
public IList<byte[]> ByteBag
368368
{
369369
get { return this._byteBag; }
370370
set { this._byteBag = value; }
@@ -373,7 +373,7 @@ public IList ByteBag
373373
/// <summary>
374374
/// Get/set for parts
375375
/// </summary>
376-
public IList Parts
376+
public IList<Part> Parts
377377
{
378378
get { return this._parts; }
379379
set { this._parts = value; }
@@ -387,18 +387,18 @@ public void SetDefaults()
387387

388388
StringSet = new HashSet<string> {"foo", "bar", "baz"};
389389

390-
StringDateMap = new SortedList();
390+
StringDateMap = new SortedList<string, DateTime?>();
391391
StringDateMap.Add("now", DateTime.Now);
392392
StringDateMap.Add("never", null); // value is persisted since NH-2199
393393
// according to SQL Server the big bag happened in 1753 ;)
394394
StringDateMap.Add("big bang", new DateTime(1753, 01, 01));
395395
//StringDateMap.Add( "millenium", new DateTime( 2000, 01, 01 ) );
396396
StringArray = StringSet.ToArray();
397-
StringList = new ArrayList(StringArray);
397+
StringList = new List<string>(StringArray);
398398
IntArray = new int[] {1, 3, 3, 7};
399399
FooArray = new Foo[0];
400400

401-
Customs = new ArrayList();
401+
Customs = new List<string[]>();
402402
Customs.Add(new String[] {"foo", "bar"});
403403
Customs.Add(new String[] {"A", "B"});
404404
Customs.Add(new String[] {"1", "2"});
@@ -419,12 +419,12 @@ public void SetDefaults()
419419

420420
Count = 667;
421421
Name = "Bazza";
422-
TopComponents = new ArrayList();
422+
TopComponents = new List<FooComponent>();
423423
TopComponents.Add(new FooComponent("foo", 11, new DateTime[] {today, new DateTime(2123, 1, 1)}, null));
424424
TopComponents.Add(
425425
new FooComponent("bar", 22, new DateTime[] {new DateTime(2007, 2, 3), new DateTime(1945, 6, 1)}, null));
426426
TopComponents.Add(null);
427-
Bag = new ArrayList();
427+
Bag = new List<string>();
428428
Bag.Add("duplicate");
429429
Bag.Add("duplicate");
430430
Bag.Add("duplicate");
@@ -440,7 +440,7 @@ public void SetDefaults()
440440
ce2.Bar = "barxxx";
441441
Cached.Add(ce);
442442
Cached.Add(ce2);
443-
CachedMap = new SortedList();
443+
CachedMap = new SortedList<Baz, CompositeElement>();
444444
CachedMap.Add(this, ce);
445445
}
446446

src/NHibernate.DomainModel/Baz.hbm.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,10 @@
199199
<element column="element" type="String" not-null="true" length="32"/>
200200
</set>
201201

202-
<map name="StringDateMap" lazy="true" sort="ReverseComparator">
202+
<map name="StringDateMap" lazy="true" sort="ReverseComparator" collection-type="sorted-list">
203203
<key column="id_"/>
204204
<index column="map_key" type="String" length="32"/>
205-
<element column="map_value" type="DateTime"/>
205+
<element column="map_value" type="DateTime" />
206206
</map>
207207

208208
<array name="FooArray" element-class="FooProxy" where="i&lt;8">
@@ -295,7 +295,7 @@
295295
</composite-element>
296296
</set>
297297

298-
<map name="CachedMap" sort="natural" table="cached_map">
298+
<map name="CachedMap" sort="natural" table="cached_map" collection-type="sorted-list">
299299
<!--<cache usage="read-write"/>-->
300300
<key column="baz"/>
301301
<index-many-to-many column="another_baz" class="Baz"/>

0 commit comments

Comments
 (0)