forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFutureCriteriaBatch.cs
50 lines (42 loc) · 1.14 KB
/
FutureCriteriaBatch.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using System;
using System.Collections;
namespace NHibernate.Impl
{
//Since 5.2
[Obsolete("Replaced by QueryBatch")]
public partial class FutureCriteriaBatch : FutureBatch<ICriteria, IMultiCriteria>
{
public FutureCriteriaBatch(SessionImpl session) : base(session) {}
protected override IList List(ICriteria query)
{
return query.List();
}
protected override IMultiCriteria CreateMultiApproach(bool isCacheable, string cacheRegion)
{
return
session.CreateMultiCriteria()
.SetCacheable(isCacheable)
.SetCacheRegion(cacheRegion);
}
protected override void AddTo(IMultiCriteria multiApproach, ICriteria query, System.Type resultType)
{
multiApproach.Add(resultType, query);
}
protected override IList GetResultsFrom(IMultiCriteria multiApproach)
{
return multiApproach.List();
}
protected override void ClearCurrentFutureBatch()
{
session.FutureCriteriaBatch = null;
}
protected override bool IsQueryCacheable(ICriteria query)
{
return ((CriteriaImpl)query).Cacheable;
}
protected override string CacheRegion(ICriteria query)
{
return ((CriteriaImpl)query).CacheRegion;
}
}
}