@@ -43,12 +43,7 @@ public abstract class Collection : IFetchable, IValue, IFilterable
43
43
private bool orphanDelete ;
44
44
private int batchSize = - 1 ;
45
45
private FetchMode fetchMode ;
46
-
47
- private string collectionPersisterClassAssemblyQualifedName ;
48
-
49
- [ NonSerialized ]
50
- private System . Type collectionPersisterClass ;
51
-
46
+ private SerializableSystemType collectionPersisterClass ;
52
47
private string referencedPropertyName ;
53
48
private string typeName ;
54
49
@@ -71,12 +66,7 @@ public abstract class Collection : IFetchable, IValue, IFilterable
71
66
private ExecuteUpdateResultCheckStyle deleteAllCheckStyle ;
72
67
73
68
private bool isGeneric ;
74
-
75
- private string [ ] genericArgumentsAssemblyQualifiedNames ;
76
-
77
- [ NonSerialized ]
78
- private System . Type [ ] genericArguments ;
79
-
69
+ private SerializableSystemType [ ] genericArguments ;
80
70
private readonly Dictionary < string , string > filters = new Dictionary < string , string > ( ) ;
81
71
private readonly Dictionary < string , string > manyToManyFilters = new Dictionary < string , string > ( ) ;
82
72
private bool subselectLoadable ;
@@ -149,16 +139,8 @@ public PersistentClass Owner
149
139
150
140
public System . Type CollectionPersisterClass
151
141
{
152
- get
153
- {
154
- if ( collectionPersisterClass != null || collectionPersisterClassAssemblyQualifedName == null ) return collectionPersisterClass ;
155
- return ( collectionPersisterClass = ReflectHelper . ClassForName ( collectionPersisterClassAssemblyQualifedName ) ) ;
156
- }
157
- set
158
- {
159
- collectionPersisterClass = value ;
160
- collectionPersisterClassAssemblyQualifedName = value ? . AssemblyQualifiedName ;
161
- }
142
+ get { return ( System . Type ) collectionPersisterClass ; }
143
+ set { collectionPersisterClass = value ; }
162
144
}
163
145
164
146
// The type of this property is object, so as to accommodate
@@ -342,26 +324,18 @@ public bool IsGeneric
342
324
/// </summary>
343
325
public System . Type [ ] GenericArguments
344
326
{
345
- get
346
- {
347
- if ( genericArguments != null || genericArgumentsAssemblyQualifiedNames == null ) return genericArguments ;
348
- return ( genericArguments = genericArgumentsAssemblyQualifiedNames . Select ( ReflectHelper . ClassForName ) . ToArray ( ) ) ;
349
- }
350
- set
351
- {
352
- genericArguments = value ;
353
- genericArgumentsAssemblyQualifiedNames = value ? . Select ( x => x . AssemblyQualifiedName ) . ToArray ( ) ;
354
- }
327
+ get => genericArguments . Select ( sst => ( System . Type ) sst ) . ToArray ( ) ;
328
+ set => genericArguments = value ? . Select ( t => ( SerializableSystemType ) t ) . ToArray ( ) ;
355
329
}
356
330
357
331
protected void CheckGenericArgumentsLength ( int expectedLength )
358
332
{
359
- if ( GenericArguments . Length != expectedLength )
333
+ if ( genericArguments . Length != expectedLength )
360
334
{
361
335
throw new MappingException (
362
336
string . Format (
363
337
"Error mapping generic collection {0}: expected {1} generic parameters, but the property type has {2}" ,
364
- Role , expectedLength , GenericArguments . Length ) ) ;
338
+ Role , expectedLength , genericArguments . Length ) ) ;
365
339
}
366
340
}
367
341
0 commit comments