Skip to content

Commit 4561f73

Browse files
author
Ivar Tiller
committed
IQueryCache constraint should be an IQueryCacheFactory constraint
The configuration setting is used to create an instance of a factory, not of the query cache itself.
1 parent ea4c7ff commit 4561f73

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

src/NHibernate.Test/CfgTest/Loquacious/ConfigurationFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public void CompleteConfiguration()
2929
.Through<HashtableCacheProvider>()
3030
.PrefixingRegionsWith("xyz")
3131
.Queries
32-
.Through<StandardQueryCache>()
32+
.Through<StandardQueryCacheFactory>()
3333
.UsingMinimalPuts()
3434
.WithDefaultExpiration(15)
3535
.GeneratingCollections

src/NHibernate.Test/CfgTest/Loquacious/LambdaConfigurationFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public void FullConfiguration()
2727
c.DefaultExpiration = 15;
2828
c.RegionsPrefix = "xyz";
2929
c.Provider<HashtableCacheProvider>();
30-
c.QueryCache<StandardQueryCache>();
30+
c.QueryCache<StandardQueryCacheFactory>();
3131
});
3232
configure.CollectionTypeFactory<DefaultCollectionTypeFactory>();
3333
configure.HqlQueryTranslator<ASTQueryTranslatorFactory>();

src/NHibernate/Cfg/Loquacious/CacheConfiguration.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public void Provider<TProvider>() where TProvider : ICacheProvider
3939
cfg.SetProperty(Environment.CacheProvider, typeof(TProvider).AssemblyQualifiedName);
4040
}
4141

42-
public void QueryCache<TFactory>() where TFactory : IQueryCache
42+
public void QueryCache<TFactory>() where TFactory : IQueryCacheFactory
4343
{
4444
UseSecondLevelCache = true;
4545
UseQueryCache = true;
@@ -111,7 +111,7 @@ public QueryCacheConfiguration(CacheConfiguration cc)
111111

112112
#region Implementation of IQueryCacheConfiguration
113113

114-
public ICacheConfiguration Through<TFactory>() where TFactory : IQueryCache
114+
public ICacheConfiguration Through<TFactory>() where TFactory : IQueryCacheFactory
115115
{
116116
cc.Configuration.SetProperty(Environment.UseSecondLevelCache, "true");
117117
cc.Configuration.SetProperty(Environment.UseQueryCache, "true");
@@ -121,4 +121,4 @@ public ICacheConfiguration Through<TFactory>() where TFactory : IQueryCache
121121

122122
#endregion
123123
}
124-
}
124+
}

src/NHibernate/Cfg/Loquacious/ICacheConfiguration.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ public interface ICacheConfigurationProperties
1717
string RegionsPrefix { set; }
1818
int DefaultExpiration { set; }
1919
void Provider<TProvider>() where TProvider : ICacheProvider;
20-
void QueryCache<TFactory>() where TFactory : IQueryCache;
20+
void QueryCache<TFactory>() where TFactory : IQueryCacheFactory;
2121
}
22-
}
22+
}

src/NHibernate/Cfg/Loquacious/IQueryCacheConfiguration.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ namespace NHibernate.Cfg.Loquacious
44
{
55
public interface IQueryCacheConfiguration
66
{
7-
ICacheConfiguration Through<TFactory>() where TFactory : IQueryCache;
7+
ICacheConfiguration Through<TFactory>() where TFactory : IQueryCacheFactory;
88
}
9-
}
9+
}

0 commit comments

Comments
 (0)