DeveelDB
20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
deveeldb.git
src
deveeldb
Deveel.Data.Sql.Cursors
FetchContext.cs
Go to the documentation of this file.
1
//
2
// Copyright 2010-2015 Deveel
3
//
4
// Licensed under the Apache License, Version 2.0 (the "License");
5
// you may not use this file except in compliance with the License.
6
// You may obtain a copy of the License at
7
//
8
// http://www.apache.org/licenses/LICENSE-2.0
9
//
10
// Unless required by applicable law or agreed to in writing, software
11
// distributed under the License is distributed on an "AS IS" BASIS,
12
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
// See the License for the specific language governing permissions and
14
// limitations under the License.
15
//
16
17
using
System
;
18
19
using
Deveel
.
Data
;
20
using
Deveel
.
Data
.
Sql
.
Expressions
;
21
22
namespace
Deveel
.Data.Sql.Cursors {
23
public
sealed
class
FetchContext
{
24
private
int
offset
;
25
26
public
FetchContext
(
IRequest
request,
SqlExpression
reference)
27
: this(request,
FetchDirection
.
Next
, reference) {
28
}
29
30
public
FetchContext
(
IRequest
request,
FetchDirection
direction,
SqlExpression
reference) {
31
if
(request == null)
32
throw
new
ArgumentNullException(
"request"
);
33
if
(reference == null)
34
throw
new
ArgumentNullException(
"reference"
);
35
36
if
(reference.
ExpressionType
!=
SqlExpressionType
.VariableReference &&
37
reference.
ExpressionType
!=
SqlExpressionType
.Reference)
38
throw
new
ArgumentException(
"Invalid reference expression type."
);
39
40
Request = request;
41
Direction = direction;
42
Reference
= reference;
43
}
44
45
public
FetchDirection
Direction {
get
;
private
set; }
46
47
public
SqlExpression
Reference
{
get
; set; }
48
49
public
bool
IsVariableReference {
50
get
{
return
Reference
.ExpressionType ==
SqlExpressionType
.VariableReference; }
51
}
52
53
public
bool
IsGlobalReference {
54
get
{
return
Reference
.ExpressionType ==
SqlExpressionType
.Reference; }
55
}
56
57
public
IRequest
Request {
get
;
private
set; }
58
59
public
int
Offset {
60
get
{
return
offset; }
61
set {
62
if
(Direction !=
FetchDirection
.Absolute &&
63
Direction !=
FetchDirection
.Relative)
64
throw
new
ArgumentException(
"Cannot set offset for this direction."
);
65
66
offset = value;
67
}
68
}
69
}
70
}
Deveel
System
Definition:
NonSerializedAttribute.cs:3
Deveel.Data.Sql.Expressions.SqlExpressionType
SqlExpressionType
All the possible type of SqlExpression supported
Definition:
SqlExpressionType.cs:23
Deveel.Data.Sql.Cursors.FetchContext.FetchContext
FetchContext(IRequest request, FetchDirection direction, SqlExpression reference)
Definition:
FetchContext.cs:30
Deveel.Data.Sql.Cursors.FetchContext.offset
int offset
Definition:
FetchContext.cs:24
Deveel.Data.Sql.Expressions.SqlExpressionType.Reference
An expression that references an object on the database (that is a Column, Table, Sequence...
Deveel.Data
Definition:
ActiveSessionList.cs:22
Deveel.Data.Sql.Cursors.FetchDirection.Next
Deveel.Data.Sql.Expressions.SqlExpression
Defines the base class for instances that represent SQL expression tree nodes.
Definition:
SqlExpression.cs:35
Deveel.Data.Sql.Expressions.SqlExpression.ExpressionType
abstract SqlExpressionType ExpressionType
Gets the type code of this SQL expression.
Definition:
SqlExpression.cs:51
Deveel.Data.Sql
Definition:
CellId.cs:22
Deveel.Data.Sql.Cursors.FetchContext
Definition:
FetchContext.cs:23
Deveel.Data.Sql.Expressions
Definition:
AggregateChecker.cs:22
Deveel.Data.IRequest
Definition:
IRequest.cs:22
Deveel.Data.Sql.Cursors.FetchContext.FetchContext
FetchContext(IRequest request, SqlExpression reference)
Definition:
FetchContext.cs:26
Deveel.Data.Sql.Cursors.FetchDirection
FetchDirection
Definition:
FetchDirection.cs:20
Generated by
1.8.10