DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Public Member Functions | Static Public Member Functions | Properties | Private Member Functions | List of all members
Deveel.Data.Sql.Statements.SqlTableConstraint Class Reference
Inheritance diagram for Deveel.Data.Sql.Statements.SqlTableConstraint:
Deveel.Data.Sql.Expressions.IPreparable Deveel.Data.Serialization.ISerializable

Public Member Functions

 SqlTableConstraint (ConstraintType constraintType, string[] columns)
 
 SqlTableConstraint (string constraintName, ConstraintType constraintType, string[] columns)
 

Static Public Member Functions

static SqlTableConstraint UniqueKey (string constraintName, string[] columns)
 
static SqlTableConstraint PrimaryKey (string constraintName, string[] columns)
 
static SqlTableConstraint Check (string constraintName, SqlExpression expression)
 
static SqlTableConstraint ForeignKey (string constraintName, string[] columns, string refTable, string[] refcolumns, ForeignKeyAction onDelete, ForeignKeyAction onUpdate)
 
static void Serialize (SqlTableConstraint constraint, BinaryWriter writer)
 
static SqlTableConstraint Deserialize (BinaryReader reader)
 

Properties

string ConstraintName [get, private set]
 
ConstraintType ConstraintType [get, private set]
 
string[] Columns [get, private set]
 
SqlExpression CheckExpression [get, set]
 
string ReferenceTable [get, set]
 
string[] ReferenceColumns [get, set]
 
ForeignKeyAction OnDelete [get, set]
 
ForeignKeyAction OnUpdate [get, set]
 

Private Member Functions

 SqlTableConstraint (ObjectData data)
 
object IPreparable. Prepare (IExpressionPreparer preparer)
 Converts the underlying value of this instance into an object that can be evaluated by an expression. More...
 
void ISerializable. GetData (SerializeData data)
 

Detailed Description

Definition at line 26 of file SqlTableConstraint.cs.

Constructor & Destructor Documentation

Deveel.Data.Sql.Statements.SqlTableConstraint.SqlTableConstraint ( ConstraintType  constraintType,
string[]  columns 
)
inline

Definition at line 27 of file SqlTableConstraint.cs.

28  : this(null, constraintType, columns) {
29  }
Deveel.Data.Sql.Statements.SqlTableConstraint.SqlTableConstraint ( string  constraintName,
ConstraintType  constraintType,
string[]  columns 
)
inline

Definition at line 31 of file SqlTableConstraint.cs.

31  {
32  ConstraintName = constraintName;
33  ConstraintType = constraintType;
34  Columns = columns;
35  }
ConstraintType
An enumeration of all the supported kinds of constraints within a table or a schema.
Deveel.Data.Sql.Statements.SqlTableConstraint.SqlTableConstraint ( ObjectData  data)
inlineprivate

Definition at line 37 of file SqlTableConstraint.cs.

37  {
38  ConstraintName = data.GetString("Name");
39  ConstraintType = (ConstraintType) data.GetInt32("Type");
40  Columns = data.GetValue<string[]>("Columns");
41  CheckExpression = data.GetValue<SqlExpression>("Check");
42  ReferenceTable = data.GetString("ReferenceTable");
43  ReferenceColumns = data.GetValue<string[]>("ReferenceColumns");
44  OnDelete = (ForeignKeyAction) data.GetInt32("OnDelete");
45  OnUpdate = (ForeignKeyAction) data.GetInt32("OnUpdate");
46  }
ForeignKeyAction
Enumerates the foreign key referential trigger actions.
ConstraintType
An enumeration of all the supported kinds of constraints within a table or a schema.
Defines the base class for instances that represent SQL expression tree nodes.

Member Function Documentation

static SqlTableConstraint Deveel.Data.Sql.Statements.SqlTableConstraint.Check ( string  constraintName,
SqlExpression  expression 
)
inlinestatic

Definition at line 84 of file SqlTableConstraint.cs.

84  {
85  return new SqlTableConstraint(constraintName, ConstraintType.Check, null) {
86  CheckExpression = expression
87  };
88  }
ConstraintType
An enumeration of all the supported kinds of constraints within a table or a schema.
SqlTableConstraint(ConstraintType constraintType, string[] columns)
static SqlTableConstraint Deveel.Data.Sql.Statements.SqlTableConstraint.Deserialize ( BinaryReader  reader)
inlinestatic

Definition at line 104 of file SqlTableConstraint.cs.

104  {
105  throw new NotImplementedException();
106  }
static SqlTableConstraint Deveel.Data.Sql.Statements.SqlTableConstraint.ForeignKey ( string  constraintName,
string[]  columns,
string  refTable,
string[]  refcolumns,
ForeignKeyAction  onDelete,
ForeignKeyAction  onUpdate 
)
inlinestatic

Definition at line 90 of file SqlTableConstraint.cs.

91  {
92  return new SqlTableConstraint(constraintName, ConstraintType.ForeignKey, columns) {
93  ReferenceTable = refTable,
94  ReferenceColumns = refcolumns,
95  OnDelete = onDelete,
96  OnUpdate = onUpdate
97  };
98  }
ConstraintType
An enumeration of all the supported kinds of constraints within a table or a schema.
SqlTableConstraint(ConstraintType constraintType, string[] columns)
void ISerializable. Deveel.Data.Sql.Statements.SqlTableConstraint.GetData ( SerializeData  data)
inlineprivate

Implements Deveel.Data.Serialization.ISerializable.

Definition at line 108 of file SqlTableConstraint.cs.

108  {
109  data.SetValue("Name", ConstraintName);
110  data.SetValue("Type", (int)ConstraintType);
111  data.SetValue("Columns", Columns);
112  data.SetValue("ReferenceTable", ReferenceTable);
113  data.SetValue("ReferenceColumns", ReferenceColumns);
114  data.SetValue("Check", CheckExpression);
115  data.SetValue("OnDelete", (int)OnDelete);
116  data.SetValue("OnUpdate", (int)OnUpdate);
117  }
void SetValue(string key, Type type, object value)
ConstraintType
An enumeration of all the supported kinds of constraints within a table or a schema.
object IPreparable. Deveel.Data.Sql.Statements.SqlTableConstraint.Prepare ( IExpressionPreparer  preparer)
inlineprivate

Converts the underlying value of this instance into an object that can be evaluated by an expression.

Parameters
preparerThe context used to prepare this object.
Returns
Returns an object that can be evaluated by an expression.

Implements Deveel.Data.Sql.Expressions.IPreparable.

Definition at line 64 of file SqlTableConstraint.cs.

64  {
65  var checkExpression = CheckExpression;
66  if (checkExpression != null)
67  checkExpression = checkExpression.Prepare(preparer);
68 
70  CheckExpression = checkExpression,
72  ReferenceColumns = ReferenceColumns
73  };
74  }
ConstraintType
An enumeration of all the supported kinds of constraints within a table or a schema.
virtual SqlExpression Prepare(IExpressionPreparer preparer)
SqlTableConstraint(ConstraintType constraintType, string[] columns)
static SqlTableConstraint Deveel.Data.Sql.Statements.SqlTableConstraint.PrimaryKey ( string  constraintName,
string[]  columns 
)
inlinestatic

Definition at line 80 of file SqlTableConstraint.cs.

80  {
81  return new SqlTableConstraint(constraintName, ConstraintType.PrimaryKey, columns);
82  }
ConstraintType
An enumeration of all the supported kinds of constraints within a table or a schema.
SqlTableConstraint(ConstraintType constraintType, string[] columns)
static void Deveel.Data.Sql.Statements.SqlTableConstraint.Serialize ( SqlTableConstraint  constraint,
BinaryWriter  writer 
)
inlinestatic

Definition at line 100 of file SqlTableConstraint.cs.

100  {
101  throw new NotImplementedException();
102  }
static SqlTableConstraint Deveel.Data.Sql.Statements.SqlTableConstraint.UniqueKey ( string  constraintName,
string[]  columns 
)
inlinestatic

Definition at line 76 of file SqlTableConstraint.cs.

76  {
77  return new SqlTableConstraint(constraintName, ConstraintType.Unique, columns);
78  }
ConstraintType
An enumeration of all the supported kinds of constraints within a table or a schema.
SqlTableConstraint(ConstraintType constraintType, string[] columns)

Property Documentation

SqlExpression Deveel.Data.Sql.Statements.SqlTableConstraint.CheckExpression
getset

Definition at line 54 of file SqlTableConstraint.cs.

string [] Deveel.Data.Sql.Statements.SqlTableConstraint.Columns
getprivate set

Definition at line 52 of file SqlTableConstraint.cs.

string Deveel.Data.Sql.Statements.SqlTableConstraint.ConstraintName
getprivate set

Definition at line 48 of file SqlTableConstraint.cs.

ConstraintType Deveel.Data.Sql.Statements.SqlTableConstraint.ConstraintType
getprivate set

Definition at line 50 of file SqlTableConstraint.cs.

ForeignKeyAction Deveel.Data.Sql.Statements.SqlTableConstraint.OnDelete
getset

Definition at line 60 of file SqlTableConstraint.cs.

ForeignKeyAction Deveel.Data.Sql.Statements.SqlTableConstraint.OnUpdate
getset

Definition at line 62 of file SqlTableConstraint.cs.

string [] Deveel.Data.Sql.Statements.SqlTableConstraint.ReferenceColumns
getset

Definition at line 58 of file SqlTableConstraint.cs.

string Deveel.Data.Sql.Statements.SqlTableConstraint.ReferenceTable
getset

Definition at line 56 of file SqlTableConstraint.cs.


The documentation for this class was generated from the following file: