@@ -43,12 +43,7 @@ public abstract class Collection : IFetchable, IValue, IFilterable
4343 private bool orphanDelete ;
4444 private int batchSize = - 1 ;
4545 private FetchMode fetchMode ;
46-
47- private string collectionPersisterClassAssemblyQualifedName ;
48-
49- [ NonSerialized ]
50- private System . Type collectionPersisterClass ;
51-
46+ private SerializableSystemType collectionPersisterClass ;
5247 private string referencedPropertyName ;
5348 private string typeName ;
5449
@@ -71,12 +66,7 @@ public abstract class Collection : IFetchable, IValue, IFilterable
7166 private ExecuteUpdateResultCheckStyle deleteAllCheckStyle ;
7267
7368 private bool isGeneric ;
74-
75- private string [ ] genericArgumentsAssemblyQualifiedNames ;
76-
77- [ NonSerialized ]
78- private System . Type [ ] genericArguments ;
79-
69+ private SerializableSystemType [ ] genericArguments ;
8070 private readonly Dictionary < string , string > filters = new Dictionary < string , string > ( ) ;
8171 private readonly Dictionary < string , string > manyToManyFilters = new Dictionary < string , string > ( ) ;
8272 private bool subselectLoadable ;
@@ -149,16 +139,8 @@ public PersistentClass Owner
149139
150140 public System . Type CollectionPersisterClass
151141 {
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 ; }
162144 }
163145
164146 // The type of this property is object, so as to accommodate
@@ -342,26 +324,18 @@ public bool IsGeneric
342324 /// </summary>
343325 public System . Type [ ] GenericArguments
344326 {
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 { return genericArguments . Cast < System . Type > ( ) . ToArray ( ) ; }
328+ set { genericArguments = value ? . Cast < SerializableSystemType > ( ) . ToArray ( ) ; }
355329 }
356330
357331 protected void CheckGenericArgumentsLength ( int expectedLength )
358332 {
359- if ( GenericArguments . Length != expectedLength )
333+ if ( genericArguments . Length != expectedLength )
360334 {
361335 throw new MappingException (
362336 string . Format (
363337 "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 ) ) ;
365339 }
366340 }
367341
0 commit comments