DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Public Member Functions | Static Public Member Functions | Properties | List of all members
Deveel.Data.Sql.Tables.ConstraintInfo Class Reference

Public Member Functions

 ConstraintInfo (ConstraintType constraintType, ObjectName tableName, string[] columnNames)
 
 ConstraintInfo (string constraintName, ConstraintType constraintType, ObjectName tableName, string[] columnNames)
 

Static Public Member Functions

static ConstraintInfo Unique (ObjectName tableName, params string[] columnNames)
 
static ConstraintInfo Unique (string constraintName, ObjectName tableName, string[] columnNames)
 
static ConstraintInfo Check (ObjectName tableName, SqlExpression expression, params string[] columnNames)
 
static ConstraintInfo Check (string constraintName, ObjectName tableName, SqlExpression expression, params string[] columnNames)
 
static ConstraintInfo PrimaryKey (ObjectName tableName, params string[] columnNames)
 
static ConstraintInfo PrimaryKey (string constraintName, ObjectName tableName, params string[] columnNames)
 
static ConstraintInfo ForeignKey (ObjectName tableName, string columnName, ObjectName refTable, string refColumn)
 
static ConstraintInfo ForeignKey (ObjectName tableName, string[] columnNames, ObjectName refTable, string[] refColumns)
 
static ConstraintInfo ForeignKey (string constraintName, ObjectName tableName, string[] columnNames, ObjectName refTable, string[] refColumns)
 

Properties

ConstraintType ConstraintType [get, private set]
 
ObjectName TableName [get, private set]
 
string ConstraintName [get, set]
 
string[] ColumnNames [get, private set]
 
SqlExpression CheckExpression [get, set]
 
ObjectName ForeignTable [get, set]
 
string[] ForeignColumnNames [get, set]
 
ForeignKeyAction OnDelete [get, set]
 
ForeignKeyAction OnUpdate [get, set]
 
ConstraintDeferrability Deferred [get, set]
 

Detailed Description

Definition at line 22 of file ConstraintInfo.cs.

Constructor & Destructor Documentation

Deveel.Data.Sql.Tables.ConstraintInfo.ConstraintInfo ( ConstraintType  constraintType,
ObjectName  tableName,
string[]  columnNames 
)
inline

Definition at line 23 of file ConstraintInfo.cs.

24  : this(null, constraintType, tableName, columnNames) {
25  }
Deveel.Data.Sql.Tables.ConstraintInfo.ConstraintInfo ( string  constraintName,
ConstraintType  constraintType,
ObjectName  tableName,
string[]  columnNames 
)
inline

Definition at line 27 of file ConstraintInfo.cs.

27  {
28  if (tableName == null)
29  throw new ArgumentNullException("tableName");
30  if (columnNames == null)
31  throw new ArgumentNullException("columnNames");
32 
33  if (columnNames.Length == 0)
34  throw new ArgumentException("The provided column names for the constraint is empty.", "columnNames");
35 
36  ConstraintName = constraintName;
37  ColumnNames = columnNames;
38  TableName = tableName;
39  ConstraintType = constraintType;
40  }

Member Function Documentation

static ConstraintInfo Deveel.Data.Sql.Tables.ConstraintInfo.Check ( ObjectName  tableName,
SqlExpression  expression,
params string[]  columnNames 
)
inlinestatic

Definition at line 70 of file ConstraintInfo.cs.

70  {
71  return Check(null, tableName, expression, columnNames);
72  }
static ConstraintInfo Check(ObjectName tableName, SqlExpression expression, params string[] columnNames)
static ConstraintInfo Deveel.Data.Sql.Tables.ConstraintInfo.Check ( string  constraintName,
ObjectName  tableName,
SqlExpression  expression,
params string[]  columnNames 
)
inlinestatic

Definition at line 74 of file ConstraintInfo.cs.

74  {
75  return new ConstraintInfo(constraintName, ConstraintType.Check, tableName, columnNames) {
76  CheckExpression = expression
77  };
78  }
ConstraintInfo(ConstraintType constraintType, ObjectName tableName, string[] columnNames)
static ConstraintInfo Deveel.Data.Sql.Tables.ConstraintInfo.ForeignKey ( ObjectName  tableName,
string  columnName,
ObjectName  refTable,
string  refColumn 
)
inlinestatic

Definition at line 88 of file ConstraintInfo.cs.

88  {
89  return ForeignKey(tableName, new[] {columnName}, refTable, new[] {refColumn});
90  }
static ConstraintInfo ForeignKey(ObjectName tableName, string columnName, ObjectName refTable, string refColumn)
static ConstraintInfo Deveel.Data.Sql.Tables.ConstraintInfo.ForeignKey ( ObjectName  tableName,
string[]  columnNames,
ObjectName  refTable,
string[]  refColumns 
)
inlinestatic

Definition at line 92 of file ConstraintInfo.cs.

92  {
93  return ForeignKey(null, tableName, columnNames, refTable, refColumns);
94  }
static ConstraintInfo ForeignKey(ObjectName tableName, string columnName, ObjectName refTable, string refColumn)
static ConstraintInfo Deveel.Data.Sql.Tables.ConstraintInfo.ForeignKey ( string  constraintName,
ObjectName  tableName,
string[]  columnNames,
ObjectName  refTable,
string[]  refColumns 
)
inlinestatic

Definition at line 96 of file ConstraintInfo.cs.

97  {
98  if (tableName == null)
99  throw new ArgumentNullException("tableName");
100  if (refTable == null)
101  throw new ArgumentNullException("refTable");
102  if (columnNames == null || columnNames.Length == 0)
103  throw new ArgumentException("At least one column is required", "columnNames");
104  if (refColumns == null || refColumns.Length == 0)
105  throw new ArgumentException("At least one referenced column is required.", "refColumns");
106 
107  if (columnNames.Length != refColumns.Length)
108  throw new ArgumentException("The number of columns in the constraint must match the number of columns referenced.");
109 
110  var constraint = new ConstraintInfo(constraintName, ConstraintType.ForeignKey, tableName, columnNames);
111  constraint.ForeignTable = refTable;
112  constraint.ForeignColumnNames = refColumns;
113  return constraint;
114  }
ConstraintInfo(ConstraintType constraintType, ObjectName tableName, string[] columnNames)
static ConstraintInfo Deveel.Data.Sql.Tables.ConstraintInfo.PrimaryKey ( ObjectName  tableName,
params string[]  columnNames 
)
inlinestatic

Definition at line 80 of file ConstraintInfo.cs.

80  {
81  return PrimaryKey(null, tableName, columnNames);
82  }
static ConstraintInfo PrimaryKey(ObjectName tableName, params string[] columnNames)
static ConstraintInfo Deveel.Data.Sql.Tables.ConstraintInfo.PrimaryKey ( string  constraintName,
ObjectName  tableName,
params string[]  columnNames 
)
inlinestatic

Definition at line 84 of file ConstraintInfo.cs.

84  {
85  return new ConstraintInfo(constraintName, ConstraintType.PrimaryKey, tableName, columnNames);
86  }
ConstraintInfo(ConstraintType constraintType, ObjectName tableName, string[] columnNames)
static ConstraintInfo Deveel.Data.Sql.Tables.ConstraintInfo.Unique ( ObjectName  tableName,
params string[]  columnNames 
)
inlinestatic

Definition at line 62 of file ConstraintInfo.cs.

62  {
63  return Unique(null, tableName, columnNames);
64  }
static ConstraintInfo Unique(ObjectName tableName, params string[] columnNames)
static ConstraintInfo Deveel.Data.Sql.Tables.ConstraintInfo.Unique ( string  constraintName,
ObjectName  tableName,
string[]  columnNames 
)
inlinestatic

Definition at line 66 of file ConstraintInfo.cs.

66  {
67  return new ConstraintInfo(constraintName, ConstraintType.Unique, tableName, columnNames);
68  }
ConstraintInfo(ConstraintType constraintType, ObjectName tableName, string[] columnNames)

Property Documentation

SqlExpression Deveel.Data.Sql.Tables.ConstraintInfo.CheckExpression
getset

Definition at line 50 of file ConstraintInfo.cs.

string [] Deveel.Data.Sql.Tables.ConstraintInfo.ColumnNames
getprivate set

Definition at line 48 of file ConstraintInfo.cs.

string Deveel.Data.Sql.Tables.ConstraintInfo.ConstraintName
getset

Definition at line 46 of file ConstraintInfo.cs.

ConstraintType Deveel.Data.Sql.Tables.ConstraintInfo.ConstraintType
getprivate set

Definition at line 42 of file ConstraintInfo.cs.

ConstraintDeferrability Deveel.Data.Sql.Tables.ConstraintInfo.Deferred
getset

Definition at line 60 of file ConstraintInfo.cs.

string [] Deveel.Data.Sql.Tables.ConstraintInfo.ForeignColumnNames
getset

Definition at line 54 of file ConstraintInfo.cs.

ObjectName Deveel.Data.Sql.Tables.ConstraintInfo.ForeignTable
getset

Definition at line 52 of file ConstraintInfo.cs.

ForeignKeyAction Deveel.Data.Sql.Tables.ConstraintInfo.OnDelete
getset

Definition at line 56 of file ConstraintInfo.cs.

ForeignKeyAction Deveel.Data.Sql.Tables.ConstraintInfo.OnUpdate
getset

Definition at line 58 of file ConstraintInfo.cs.

ObjectName Deveel.Data.Sql.Tables.ConstraintInfo.TableName
getprivate set

Definition at line 44 of file ConstraintInfo.cs.


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