Skip to content

Commit de40e89

Browse files
committed
Removed configuration methods which were obsoleted in the previous
release.
1 parent 7334656 commit de40e89

File tree

4 files changed

+3
-202
lines changed

4 files changed

+3
-202
lines changed

src/FluentNHibernate.Testing/Cfg/Db/PersistenceConfigurationTester.cs

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,6 @@ public void ConfigureProperties_should_not_override_values_already_set()
3939

4040
}
4141

42-
#pragma warning disable 612,618
43-
[Test]
44-
public void ConfigureProperties_should_override_values_already_set_with_values_set_in_code()
45-
{
46-
_nhibConfig = new Configuration();
47-
_nhibConfig.Properties["proxyfactory.factory_class"] = "foo";
48-
_config.ProxyFactoryFactory("bar").ConfigureProperties(_nhibConfig);
49-
ValueOf("proxyfactory.factory_class").ShouldEqual("bar");
50-
}
51-
#pragma warning restore 612,618
52-
5342
[Test]
5443
public void Setting_raw_values_should_populate_dictionary()
5544
{
@@ -96,50 +85,6 @@ public void Use_Reflection_Optimizer_should_set_value_to_const_true()
9685

9786
}
9887

99-
#pragma warning disable 612,618
100-
101-
[Test]
102-
public void Provider_Class_should_set_property_value()
103-
{
104-
_config.Cache(c => c
105-
.ProviderClass("foo"));
106-
ValueOf("cache.provider_class").ShouldEqual("foo");
107-
108-
}
109-
110-
[Test]
111-
public void Use_Minimal_Puts_should_set_value_to_const_true()
112-
{
113-
_config.Cache(c => c
114-
.UseMinimalPuts());
115-
ValueOf("cache.use_minimal_puts").ShouldEqual("true");
116-
}
117-
118-
[Test]
119-
public void Use_Query_Cache_should_set_value_to_const_true()
120-
{
121-
_config.Cache(c => c
122-
.UseQueryCache());
123-
ValueOf("cache.use_query_cache").ShouldEqual("true");
124-
}
125-
126-
[Test]
127-
public void Query_Cache_Factory_should_set_property_value()
128-
{
129-
_config.Cache(c => c
130-
.QueryCacheFactory("foo"));
131-
ValueOf("cache.query_cache_factory").ShouldEqual("foo");
132-
}
133-
134-
[Test]
135-
public void Region_Prefix_should_set_property_value()
136-
{
137-
_config.Cache(c => c
138-
.RegionPrefix("foo"));
139-
ValueOf("cache.region_prefix").ShouldEqual("foo");
140-
}
141-
#pragma warning restore 612,618
142-
14388
[Test]
14489
public void Query_Substitutions_should_set_property_value()
14590
{

src/FluentNHibernate.Testing/Cfg/FluentConfigurationTests.cs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -147,28 +147,6 @@ public void ShouldSetCurrentSessionContextUsingGeneric()
147147
configuration.Properties["current_session_context_class"].ShouldEqual(typeof(NHibernate.Context.ThreadStaticSessionContext).AssemblyQualifiedName);
148148
}
149149

150-
#pragma warning disable 612,618
151-
[Test]
152-
public void ShouldSetCurrentSessionContext_Obsolete()
153-
{
154-
var configuration = Fluently.Configure()
155-
.Database(SQLiteConfiguration.Standard.CurrentSessionContext("thread_static").InMemory)
156-
.BuildConfiguration();
157-
158-
configuration.Properties["current_session_context_class"].ShouldEqual("thread_static");
159-
}
160-
161-
[Test]
162-
public void ShouldSetCurrentSessionContextUsingGeneric_Obsolete()
163-
{
164-
var configuration = Fluently.Configure()
165-
.Database(SQLiteConfiguration.Standard.CurrentSessionContext<NHibernate.Context.ThreadStaticSessionContext>())
166-
.BuildConfiguration();
167-
168-
configuration.Properties["current_session_context_class"].ShouldEqual(typeof(NHibernate.Context.ThreadStaticSessionContext).AssemblyQualifiedName);
169-
}
170-
#pragma warning restore 612,618
171-
172150
[Test]
173151
public void ShouldSetConnectionIsolationLevel()
174152
{

src/FluentNHibernate/Cfg/Db/PersistenceConfiguration.cs

Lines changed: 0 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using System.Collections.Generic;
33
using System.Data;
44
using System.Linq;
5-
using NHibernate.Bytecode;
65
using NHibernate.Connection;
76
using NHibernate.Dialect;
87
using NHibernate.Driver;
@@ -35,8 +34,6 @@ public abstract class PersistenceConfiguration<TThisConfiguration, TConnectionSt
3534
protected const string DriverClassKey = NHibEnvironment.ConnectionDriver;
3635
protected const string ConnectionStringKey = NHibEnvironment.ConnectionString;
3736
protected const string IsolationLevelKey = NHibEnvironment.Isolation;
38-
protected const string ProxyFactoryFactoryClassKey = "proxyfactory.factory_class";
39-
protected const string DefaultProxyFactoryFactoryClassName = "NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle";
4037
protected const string AdoNetBatchSizeKey = NHibEnvironment.BatchSize;
4138
protected const string CurrentSessionContextClassKey = "current_session_context_class";
4239

@@ -49,7 +46,6 @@ public abstract class PersistenceConfiguration<TThisConfiguration, TConnectionSt
4946
protected PersistenceConfiguration()
5047
{
5148
values[ConnectionProviderKey] = DefaultConnectionProviderClassName;
52-
values[ProxyFactoryFactoryClassKey] = DefaultProxyFactoryFactoryClassName;
5349
connectionString = new TConnectionString();
5450
}
5551

@@ -73,9 +69,6 @@ static IEnumerable<string> OverridenDefaults(IDictionary<string,string> settings
7369
{
7470
if (settings[ConnectionProviderKey] != DefaultConnectionProviderClassName)
7571
yield return ConnectionProviderKey;
76-
77-
if (settings[ProxyFactoryFactoryClassKey] != DefaultProxyFactoryFactoryClassName)
78-
yield return ProxyFactoryFactoryClassKey;
7972
}
8073

8174
private static IEnumerable<string> KeysToPreserve(NHibConfiguration nhibernateConfig, IDictionary<string, string> settings)
@@ -300,25 +293,6 @@ public TThisConfiguration ConnectionString(string value)
300293
return (TThisConfiguration)this;
301294
}
302295

303-
/// <summary>
304-
/// Configure caching.
305-
/// </summary>
306-
/// <example>
307-
/// Cache(x =>
308-
/// {
309-
/// x.UseQueryCache();
310-
/// x.UseMinimalPuts();
311-
/// });
312-
/// </example>
313-
/// <param name="cacheExpression">Closure for configuring caching</param>
314-
/// <returns>Configuration builder</returns>
315-
[Obsolete("Moved to FluentConfiguration (Fluently.Configure().Cache(...))")]
316-
public TThisConfiguration Cache(Action<CacheSettingsBuilder> cacheExpression)
317-
{
318-
cacheExpression(cache);
319-
return (TThisConfiguration)this;
320-
}
321-
322296
/// <summary>
323297
/// Sets a raw property on the NHibernate configuration. Use this method
324298
/// if there isn't a specific option available in the API.
@@ -332,82 +306,6 @@ public TThisConfiguration Raw(string key, string value)
332306
return (TThisConfiguration) this;
333307
}
334308

335-
/// <summary>
336-
/// Sets the collectiontype.factory_class property.
337-
/// NOTE: NHibernate 2.1 only
338-
/// </summary>
339-
/// <param name="collectionTypeFactoryClass">factory class</param>
340-
/// <returns>Configuration</returns>
341-
[Obsolete("Moved to FluentConfiguration (Fluently.Configure().CollectionTypeFactory(...))")]
342-
public TThisConfiguration CollectionTypeFactory(string collectionTypeFactoryClass)
343-
{
344-
values[CollectionTypeFactoryClassKey] = collectionTypeFactoryClass;
345-
return (TThisConfiguration)this;
346-
}
347-
348-
/// <summary>
349-
/// Sets the collectiontype.factory_class property.
350-
/// NOTE: NHibernate 2.1 only
351-
/// </summary>
352-
/// <param name="collectionTypeFactoryClass">factory class</param>
353-
/// <returns>Configuration</returns>
354-
[Obsolete("Moved to FluentConfiguration (Fluently.Configure().CollectionTypeFactory(...))")]
355-
public TThisConfiguration CollectionTypeFactory(Type collectionTypeFactoryClass)
356-
{
357-
values[CollectionTypeFactoryClassKey] = collectionTypeFactoryClass.AssemblyQualifiedName;
358-
return (TThisConfiguration)this;
359-
}
360-
361-
/// <summary>
362-
/// Sets the collectiontype.factory_class property.
363-
/// NOTE: NHibernate 2.1 only
364-
/// </summary>
365-
/// <typeparam name="TCollectionTypeFactory">factory class</typeparam>
366-
/// <returns>Configuration</returns>
367-
[Obsolete("Moved to FluentConfiguration (Fluently.Configure().CollectionTypeFactory(...))")]
368-
public TThisConfiguration CollectionTypeFactory<TCollectionTypeFactory>() where TCollectionTypeFactory : ICollectionTypeFactory
369-
{
370-
return CollectionTypeFactory(typeof(TCollectionTypeFactory));
371-
}
372-
373-
/// <summary>
374-
/// Sets the proxyfactory.factory_class property.
375-
/// NOTE: NHibernate 2.1 only
376-
/// </summary>
377-
/// <param name="proxyFactoryFactoryClass">factory class</param>
378-
/// <returns>Configuration</returns>
379-
[Obsolete("Moved to FluentConfiguration (Fluently.Configure().ProxyFactoryFactory(...))")]
380-
public TThisConfiguration ProxyFactoryFactory(string proxyFactoryFactoryClass)
381-
{
382-
values[ProxyFactoryFactoryClassKey] = proxyFactoryFactoryClass;
383-
return (TThisConfiguration)this;
384-
}
385-
386-
/// <summary>
387-
/// Sets the proxyfactory.factory_class property.
388-
/// NOTE: NHibernate 2.1 only
389-
/// </summary>
390-
/// <param name="proxyFactoryFactory">factory class</param>
391-
/// <returns>Configuration</returns>
392-
[Obsolete("Moved to FluentConfiguration (Fluently.Configure().ProxyFactoryFactory(...))")]
393-
public TThisConfiguration ProxyFactoryFactory(Type proxyFactoryFactory)
394-
{
395-
values[ProxyFactoryFactoryClassKey] = proxyFactoryFactory.AssemblyQualifiedName;
396-
return (TThisConfiguration)this;
397-
}
398-
399-
/// <summary>
400-
/// Sets the proxyfactory.factory_class property.
401-
/// NOTE: NHibernate 2.1 only
402-
/// </summary>
403-
/// <typeparam name="TProxyFactoryFactory">factory class</typeparam>
404-
/// <returns>Configuration</returns>
405-
[Obsolete("Moved to FluentConfiguration (Fluently.Configure().ProxyFactoryFactory(...))")]
406-
public TThisConfiguration ProxyFactoryFactory<TProxyFactoryFactory>() where TProxyFactoryFactory : IProxyFactoryFactory
407-
{
408-
return ProxyFactoryFactory(typeof(TProxyFactoryFactory));
409-
}
410-
411309
/// <summary>
412310
/// Sets the adonet.batch_size property.
413311
/// </summary>
@@ -419,29 +317,6 @@ public TThisConfiguration AdoNetBatchSize(int size)
419317
return (TThisConfiguration)this;
420318
}
421319

422-
/// <summary>
423-
/// Sets the current_session_context_class property.
424-
/// </summary>
425-
/// <param name="currentSessionContextClass">current session context class</param>
426-
/// <returns>Configuration</returns>
427-
[Obsolete("Moved to FluentConfiguration (Fluently.Configure().CurrentSessionContext(...))")]
428-
public TThisConfiguration CurrentSessionContext(string currentSessionContextClass)
429-
{
430-
values[CurrentSessionContextClassKey] = currentSessionContextClass;
431-
return (TThisConfiguration)this;
432-
}
433-
434-
/// <summary>
435-
/// Sets the current_session_context_class property.
436-
/// </summary>
437-
/// <typeparam name="TSessionContext">Implementation of ICurrentSessionContext to use</typeparam>
438-
/// <returns>Configuration</returns>
439-
[Obsolete("Moved to FluentConfiguration (Fluently.Configure().CurrentSessionContext(...))")]
440-
public TThisConfiguration CurrentSessionContext<TSessionContext>() where TSessionContext : NHibernate.Context.ICurrentSessionContext
441-
{
442-
return CurrentSessionContext(typeof(TSessionContext).AssemblyQualifiedName);
443-
}
444-
445320
/// <summary>
446321
/// Sets the connection isolation level. NHibernate setting: connection.isolation
447322
/// </summary>

src/FluentNHibernate/Cfg/FluentConfiguration.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ internal FluentConfiguration()
4141
internal FluentConfiguration(Configuration cfg)
4242
{
4343
this.cfg = cfg;
44+
45+
#if NH21
4446
this.ProxyFactoryFactory(DefaultProxyFactoryFactoryClassName);
47+
#endif
4548
}
4649

4750
internal Configuration Configuration

0 commit comments

Comments
 (0)