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.Triggers
TriggerBody.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
using
System
.Collections.Generic;
19
20
using
Deveel
.
Data
.
Sql
.
Statements
;
21
22
namespace
Deveel
.Data.Sql.Triggers {
23
public
sealed
class
TriggerBody
{
24
private
readonly List<SqlStatement>
statements
;
25
26
internal
TriggerBody
(
TriggerInfo
triggerInfo) {
27
if
(triggerInfo == null)
28
throw
new
ArgumentNullException(
"triggerInfo"
);
29
30
TriggerInfo
= triggerInfo;
31
32
statements =
new
List<SqlStatement>();
33
}
34
35
public
TriggerInfo
TriggerInfo
{
get
;
private
set; }
36
37
private
void
AssertStatementIsAllowed
(
SqlStatement
statement) {
38
// TODO: validate this statement
39
}
40
41
42
public
void
AddStatement
(
SqlStatement
statement) {
43
if
(statement == null)
44
throw
new
ArgumentNullException(
"statement"
);
45
46
if
(
TriggerInfo
.
TriggerType
!=
TriggerType
.Procedure)
47
throw
new
ArgumentException(String.Format(
"The trigger '{0}' is not a PROCEDURE TRIGGER and cannot have any body."
,
48
TriggerInfo
.
TriggerName
));
49
50
AssertStatementIsAllowed(statement);
51
52
statements.Add(statement);
53
}
54
}
55
}
Deveel.Data.Sql.Triggers.TriggerInfo
Defines the information about a trigger on a table of the database, such as the event on which is fir...
Definition:
TriggerInfo.cs:29
Deveel
System
Definition:
NonSerializedAttribute.cs:3
Deveel.Data.Sql.Statements
Definition:
AddColumnAction.cs:22
Deveel.Data.Sql.Triggers.TriggerBody.AddStatement
void AddStatement(SqlStatement statement)
Definition:
TriggerBody.cs:42
Deveel.Data.Sql.Triggers.TriggerBody.TriggerBody
TriggerBody(TriggerInfo triggerInfo)
Definition:
TriggerBody.cs:26
Deveel.Data.Sql.Statements.SqlStatement
Represents the foundation class of SQL statements to be executed.
Definition:
SqlStatement.cs:32
Deveel.Data.Sql.Triggers.TriggerInfo.TriggerName
ObjectName TriggerName
Gets the fully qualified name of the trigger.
Definition:
TriggerInfo.cs:78
Deveel.Data.Sql.Triggers.TriggerBody
Definition:
TriggerBody.cs:23
Deveel.Data.Sql.Triggers.TriggerBody.statements
readonly List< SqlStatement > statements
Definition:
TriggerBody.cs:24
Deveel.Data.Sql.Triggers.TriggerType
TriggerType
Enumerates the types of triggers, that can be volatile (like the Callback) or stored in the database...
Definition:
TriggerType.cs:22
Deveel.Data.Sql.Triggers.TriggerBody.AssertStatementIsAllowed
void AssertStatementIsAllowed(SqlStatement statement)
Definition:
TriggerBody.cs:37
Deveel.Data
Definition:
ActiveSessionList.cs:22
Deveel.Data.Sql
Definition:
CellId.cs:22
Deveel.Data.Sql.Triggers.TriggerInfo.TriggerType
TriggerType TriggerType
Gets the type of trigger.
Definition:
TriggerInfo.cs:90
Generated by
1.8.10