forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFutureQueryBatch.cs
58 lines (49 loc) · 1.34 KB
/
FutureQueryBatch.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
51
52
53
54
55
56
57
58
using System;
using System.Collections;
using NHibernate.Transform;
namespace NHibernate.Impl
{
//Since 5.2
[Obsolete("Replaced by QueryBatch")]
public partial class FutureQueryBatch : FutureBatch<IQuery, IMultiQuery>
{
public FutureQueryBatch(SessionImpl session) : base(session)
{
}
protected override IList List(IQuery query)
{
return query.List();
}
protected override IMultiQuery CreateMultiApproach(bool isCacheable, string cacheRegion)
{
return
session.CreateMultiQuery()
.SetCacheable(isCacheable)
.SetCacheRegion(cacheRegion);
}
protected override void AddTo(IMultiQuery multiApproach, IQuery query, System.Type resultType)
{
multiApproach.Add(resultType, query);
}
protected override void AddResultTransformer(IMultiQuery multiApproach, IResultTransformer futureResulsTransformer)
{
multiApproach.SetResultTransformer(futureResulsTransformer);
}
protected override IList GetResultsFrom(IMultiQuery multiApproach)
{
return multiApproach.List();
}
protected override void ClearCurrentFutureBatch()
{
session.FutureQueryBatch = null;
}
protected override bool IsQueryCacheable(IQuery query)
{
return ((AbstractQueryImpl) query).Cacheable;
}
protected override string CacheRegion(IQuery query)
{
return ((AbstractQueryImpl) query).CacheRegion;
}
}
}