@@ -27,6 +27,7 @@ public abstract class PersistenceConfiguration<TThisConfiguration, TConnectionSt
27
27
protected const string ShowSqlKey = "show_sql" ;
28
28
protected const string FormatSqlKey = "format_sql" ;
29
29
30
+ protected const string CollectionTypeFactoryClassKey = NHibernate . Cfg . Environment . CollectionTypeFactoryClass ;
30
31
protected const string ConnectionProviderKey = "connection.provider" ;
31
32
protected const string DefaultConnectionProviderClassName = "NHibernate.Connection.DriverConnectionProvider" ;
32
33
protected const string DriverClassKey = "connection.driver_class" ;
@@ -306,6 +307,41 @@ public TThisConfiguration Raw(string key, string value)
306
307
return ( TThisConfiguration ) this ;
307
308
}
308
309
310
+ /// <summary>
311
+ /// Sets the collectiontype.factory_class property.
312
+ /// NOTE: NHibernate 2.1 only
313
+ /// </summary>
314
+ /// <param name="collectionTypeFactoryClass">factory class</param>
315
+ /// <returns>Configuration</returns>
316
+ public TThisConfiguration CollectionTypeFactory ( string collectionTypeFactoryClass )
317
+ {
318
+ values [ CollectionTypeFactoryClassKey ] = collectionTypeFactoryClass ;
319
+ return ( TThisConfiguration ) this ;
320
+ }
321
+
322
+ /// <summary>
323
+ /// Sets the collectiontype.factory_class property.
324
+ /// NOTE: NHibernate 2.1 only
325
+ /// </summary>
326
+ /// <param name="collectionTypeFactoryClass">factory class</param>
327
+ /// <returns>Configuration</returns>
328
+ public TThisConfiguration CollectionTypeFactory ( Type collectionTypeFactoryClass )
329
+ {
330
+ values [ CollectionTypeFactoryClassKey ] = collectionTypeFactoryClass . AssemblyQualifiedName ;
331
+ return ( TThisConfiguration ) this ;
332
+ }
333
+
334
+ /// <summary>
335
+ /// Sets the collectiontype.factory_class property.
336
+ /// NOTE: NHibernate 2.1 only
337
+ /// </summary>
338
+ /// <typeparam name="TCollectionTypeFactory">factory class</typeparam>
339
+ /// <returns>Configuration</returns>
340
+ public TThisConfiguration CollectionTypeFactory < TCollectionTypeFactory > ( ) where TCollectionTypeFactory : ICollectionTypeFactory
341
+ {
342
+ return CollectionTypeFactory ( typeof ( TCollectionTypeFactory ) ) ;
343
+ }
344
+
309
345
/// <summary>
310
346
/// Sets the proxyfactory.factory_class property.
311
347
/// NOTE: NHibernate 2.1 only
0 commit comments