forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathILoader.cs
125 lines (102 loc) · 4.41 KB
/
ILoader.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data.Common;
using NHibernate.Cache;
using NHibernate.Engine;
using NHibernate.Persister;
using NHibernate.Persister.Entity;
using NHibernate.SqlCommand;
using NHibernate.Transform;
using NHibernate.Type;
namespace NHibernate.Loader
{
public partial interface ILoader
{
bool IsSubselectLoadingEnabled { get; }
/// <summary>
/// The result types of the result set, for query loaders.
/// </summary>
IType[] ResultTypes { get; }
IType[] CacheTypes { get; }
Loader.QueryCacheInfo CacheInfo { get; }
ISessionFactoryImplementor Factory { get; }
/// <summary>
/// The SqlString to be called; implemented by all subclasses
/// </summary>
SqlString SqlString { get; }
/// <summary>
/// An array of persisters of entity classes contained in each row of results;
/// implemented by all subclasses
/// </summary>
/// <remarks>
/// The <c>setter</c> was added so that classes inheriting from Loader could write a
/// value using the Property instead of directly to the field.
/// </remarks>
ILoadable[] EntityPersisters { get; }
/// <summary>
/// Identifies the query for statistics reporting, if null,
/// no statistics will be reported
/// </summary>
string QueryIdentifier { get; }
/// <summary>
/// What lock mode does this load entities with?
/// </summary>
/// <param name="lockModes">A Collection of lock modes specified dynamically via the Query Interface</param>
/// <returns></returns>
LockMode[] GetLockModes(IDictionary<string, LockMode> lockModes);
object GetRowFromResultSet(DbDataReader resultSet, ISessionImplementor session,
QueryParameters queryParameters, LockMode[] lockModeArray,
EntityKey optionalObjectKey, IList hydratedObjects, EntityKey[] keys,
bool returnProxies, IResultTransformer forcedResultTransformer,
QueryCacheResultBuilder queryCacheResultBuilder,
Action<IEntityPersister, CachePutData> cacheBatchingHandler);
void CreateSubselects(List<EntityKey[]> keys, QueryParameters queryParameters, ISessionImplementor session);
void InitializeEntitiesAndCollections(IList hydratedObjects,
DbDataReader reader,
ISessionImplementor session,
bool readOnly,
CacheBatcher cacheBatcher);
IList GetResultList(IList results, IResultTransformer resultTransformer);
/// <summary>
/// Should we pre-process the SQL string, adding a dialect-specific
/// LIMIT clause.
/// </summary>
/// <param name="selection"></param>
/// <param name="dialect"></param>
/// <returns></returns>
bool UseLimit(RowSelection selection, Dialect.Dialect dialect);
/// <summary>
/// Called by subclasses that load collections
/// </summary>
void LoadCollection(ISessionImplementor session,
object id,
IType type);
/// <summary>
/// Called by wrappers that batch initialize collections
/// </summary>
void LoadCollectionBatch(ISessionImplementor session,
object[] ids,
IType type);
bool IsCacheable(QueryParameters queryParameters);
bool IsCacheable(QueryParameters queryParameters,
bool supportsQueryCache,
IEnumerable<IPersister> persisters);
string ToString();
ISqlCommand CreateSqlCommand(QueryParameters queryParameters,
ISessionImplementor session);
void AutoDiscoverTypes(DbDataReader rs,
QueryParameters queryParameters,
IResultTransformer forcedResultTransformer);
IList TransformCacheableResults(QueryParameters queryParameters,
CacheableResultTransformer transformer,
IList result);
void HandleEmptyCollections(object[] keys,
object resultSetId,
ISessionImplementor session);
void StopLoadingCollections(ISessionImplementor session,
DbDataReader reader);
QueryKey GenerateQueryKey(ISessionImplementor session,
QueryParameters queryParameters);
}
}