@@ -60,7 +60,6 @@ public sealed class PropertyReference
60
60
private string catalogName ;
61
61
private string defaultCascade ;
62
62
private string defaultNamespace ;
63
- private readonly Dialect . Dialect dialect ;
64
63
private string defaultAssembly ;
65
64
private string defaultAccess ;
66
65
private bool autoImport ;
@@ -89,6 +88,11 @@ public sealed class PropertyReference
89
88
/// </summary>
90
89
protected internal IDictionary < string , TableDescription > tableNameBinding ;
91
90
91
+ //6.0 TODO: Remove
92
+ internal Lazy < Dialect . Dialect > LazyDialect ;
93
+
94
+ //Since v5.2
95
+ [ Obsolete ( "Please use constructor without a dialect parameter." ) ]
92
96
protected internal Mappings (
93
97
IDictionary < string , PersistentClass > classes ,
94
98
IDictionary < string , Mapping . Collection > collections ,
@@ -112,7 +116,57 @@ protected internal Mappings(
112
116
string defaultCatalog ,
113
117
string defaultSchema ,
114
118
string preferPooledValuesLo ,
115
- Dialect . Dialect dialect )
119
+ Dialect . Dialect dialect ) :
120
+ this (
121
+ classes ,
122
+ collections ,
123
+ tables ,
124
+ queries ,
125
+ sqlqueries ,
126
+ resultSetMappings ,
127
+ imports ,
128
+ secondPasses ,
129
+ filtersSecondPasses ,
130
+ propertyReferences ,
131
+ namingStrategy ,
132
+ typeDefs ,
133
+ filterDefinitions ,
134
+ extendsQueue ,
135
+ auxiliaryDatabaseObjects ,
136
+ tableNameBinding ,
137
+ columnNameBindingPerTable ,
138
+ defaultAssembly ,
139
+ defaultNamespace ,
140
+ defaultCatalog ,
141
+ defaultSchema ,
142
+ preferPooledValuesLo )
143
+ {
144
+ LazyDialect = new Lazy < Dialect . Dialect > ( ( ) => dialect ) ;
145
+ }
146
+
147
+ protected internal Mappings (
148
+ IDictionary < string , PersistentClass > classes ,
149
+ IDictionary < string , Mapping . Collection > collections ,
150
+ IDictionary < string , Table > tables ,
151
+ IDictionary < string , NamedQueryDefinition > queries ,
152
+ IDictionary < string , NamedSQLQueryDefinition > sqlqueries ,
153
+ IDictionary < string , ResultSetMappingDefinition > resultSetMappings ,
154
+ IDictionary < string , string > imports ,
155
+ IList < SecondPassCommand > secondPasses ,
156
+ Queue < FilterSecondPassArgs > filtersSecondPasses ,
157
+ IList < PropertyReference > propertyReferences ,
158
+ INamingStrategy namingStrategy ,
159
+ IDictionary < string , TypeDef > typeDefs ,
160
+ IDictionary < string , FilterDefinition > filterDefinitions ,
161
+ ISet < ExtendsQueueEntry > extendsQueue ,
162
+ IList < IAuxiliaryDatabaseObject > auxiliaryDatabaseObjects ,
163
+ IDictionary < string , TableDescription > tableNameBinding ,
164
+ IDictionary < Table , ColumnNames > columnNameBindingPerTable ,
165
+ string defaultAssembly ,
166
+ string defaultNamespace ,
167
+ string defaultCatalog ,
168
+ string defaultSchema ,
169
+ string preferPooledValuesLo )
116
170
{
117
171
this . classes = classes ;
118
172
this . collections = collections ;
@@ -135,7 +189,6 @@ protected internal Mappings(
135
189
DefaultCatalog = defaultCatalog ;
136
190
DefaultSchema = defaultSchema ;
137
191
PreferPooledValuesLo = preferPooledValuesLo ;
138
- this . dialect = dialect ;
139
192
this . filtersSecondPasses = filtersSecondPasses ;
140
193
}
141
194
@@ -183,10 +236,9 @@ public PersistentClass GetClass(string className)
183
236
return result ;
184
237
}
185
238
186
- public Dialect . Dialect Dialect
187
- {
188
- get { return dialect ; }
189
- }
239
+ //Since v5.2
240
+ [ Obsolete ( "This property will be removed in a future version." ) ]
241
+ public Dialect . Dialect Dialect => LazyDialect . Value ;
190
242
191
243
/// <summary>
192
244
///
@@ -260,7 +312,7 @@ public void AddImport(string className, string rename)
260
312
261
313
public Table AddTable ( string schema , string catalog , string name , string subselect , bool isAbstract , string schemaAction )
262
314
{
263
- string key = subselect ?? dialect . Qualify ( catalog , schema , name ) ;
315
+ string key = subselect ?? BuildTableNameKey ( catalog , schema , name ) ;
264
316
Table table ;
265
317
if ( ! tables . TryGetValue ( key , out table ) )
266
318
{
@@ -327,7 +379,7 @@ private static SchemaAction GetSchemaActions(string schemaAction)
327
379
328
380
public Table AddDenormalizedTable ( string schema , string catalog , string name , bool isAbstract , string subselect , Table includedTable )
329
381
{
330
- string key = subselect ?? dialect . Qualify ( schema , catalog , name ) ;
382
+ string key = subselect ?? BuildTableNameKey ( schema , catalog , name ) ;
331
383
332
384
Table table = new DenormalizedTable ( includedTable )
333
385
{
@@ -370,7 +422,7 @@ public void AddTableBinding(string schema, string catalog, string logicalName, s
370
422
371
423
public Table GetTable ( string schema , string catalog , string name )
372
424
{
373
- string key = dialect . Qualify ( catalog , schema , name ) ;
425
+ string key = BuildTableNameKey ( catalog , schema , name ) ;
374
426
return tables [ key ] ;
375
427
}
376
428
0 commit comments