-
Notifications
You must be signed in to change notification settings - Fork 934
/
Copy pathNamedQueryDefinition.cs
111 lines (95 loc) · 2.21 KB
/
NamedQueryDefinition.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
using System;
using System.Collections.Generic;
namespace NHibernate.Engine
{
[Serializable]
public class NamedQueryDefinition
{
private readonly string query;
private readonly bool cacheable;
private readonly string cacheRegion;
private readonly int timeout = -1;
private readonly int fetchSize = -1;
private readonly FlushMode flushMode = FlushMode.Unspecified;
private readonly IDictionary<string, string> parameterTypes;
private readonly CacheMode? cacheMode;
private readonly bool readOnly;
private readonly string comment;
public NamedQueryDefinition(string query, bool cacheable, string cacheRegion, int timeout,
int fetchSize, FlushMode flushMode, bool readOnly, string comment, IDictionary<string, string> parameterTypes)
: this(query,cacheable,cacheRegion,timeout,fetchSize,flushMode,null,readOnly,comment,parameterTypes)
{}
public NamedQueryDefinition(
string query,
bool cacheable,
string cacheRegion,
int timeout,
int fetchSize,
FlushMode flushMode,
CacheMode? cacheMode,
bool readOnly,
string comment,
IDictionary<string,string> parameterTypes
)
{
this.query = query;
this.cacheable = cacheable;
this.cacheRegion = cacheRegion;
this.timeout = timeout;
this.fetchSize = fetchSize;
this.flushMode = flushMode;
this.parameterTypes = parameterTypes;
this.cacheMode = cacheMode;
this.readOnly = readOnly;
this.comment = comment;
}
public string QueryString
{
get { return query; }
}
public bool IsCacheable
{
get { return cacheable; }
}
public string CacheRegion
{
get { return cacheRegion; }
}
public int FetchSize
{
get { return fetchSize; }
}
public int Timeout
{
get { return timeout; }
}
public FlushMode FlushMode
{
get { return flushMode; }
}
public override string ToString()
{
return GetType().FullName + '(' + query + ')';
}
public IDictionary<string, string> ParameterTypes
{
get { return parameterTypes; }
}
public string Query
{
get { return query; }
}
public bool IsReadOnly
{
get { return readOnly; }
}
public string Comment
{
get { return comment; }
}
public CacheMode? CacheMode
{
get { return cacheMode; }
}
}
}