@@ -239,6 +239,40 @@ public bool HasNonIdentifierPropertyNamedId(string className)
239
239
NHibernate . Dialect . Dialect . GetDialect ( configuration . Properties ) ;
240
240
}
241
241
242
+ [ Serializable ]
243
+ private class StaticDialectMappingWrapper : IMapping
244
+ {
245
+ private readonly IMapping _mapping ;
246
+
247
+ public StaticDialectMappingWrapper ( IMapping mapping )
248
+ {
249
+ _mapping = mapping ;
250
+ Dialect = mapping . Dialect ;
251
+ }
252
+
253
+ public IType GetIdentifierType ( string className )
254
+ {
255
+ return _mapping . GetIdentifierType ( className ) ;
256
+ }
257
+
258
+ public string GetIdentifierPropertyName ( string className )
259
+ {
260
+ return _mapping . GetIdentifierPropertyName ( className ) ;
261
+ }
262
+
263
+ public IType GetReferencedPropertyType ( string className , string propertyName )
264
+ {
265
+ return _mapping . GetReferencedPropertyType ( className , propertyName ) ;
266
+ }
267
+
268
+ public bool HasNonIdentifierPropertyNamedId ( string className )
269
+ {
270
+ return _mapping . HasNonIdentifierPropertyNamedId ( className ) ;
271
+ }
272
+
273
+ public Dialect . Dialect Dialect { get ; }
274
+ }
275
+
242
276
private IMapping mapping ;
243
277
244
278
protected Configuration ( SettingsFactory settingsFactory )
@@ -1272,7 +1306,7 @@ public ISessionFactory BuildSessionFactory()
1272
1306
// Ok, don't need schemas anymore, so free them
1273
1307
Schemas = null ;
1274
1308
1275
- return new SessionFactoryImpl ( this , mapping , settings , GetInitializedEventListeners ( ) ) ;
1309
+ return new SessionFactoryImpl ( this , new StaticDialectMappingWrapper ( mapping ) , settings , GetInitializedEventListeners ( ) ) ;
1276
1310
}
1277
1311
1278
1312
/// <summary>
0 commit comments