DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Protected Member Functions | Package Functions | Properties | Private Attributes | List of all members
Deveel.Data.Sql.Parser.ColumnConstraintNode Class Reference
Inheritance diagram for Deveel.Data.Sql.Parser.ColumnConstraintNode:
Deveel.Data.Sql.Parser.SqlNode Deveel.Data.Sql.Parser.ISqlNode

Protected Member Functions

override ISqlNode OnChildNode (ISqlNode node)
 During the initialization of the node from the parser, this method is called for every child node added to ChildNodes More...
 
- Protected Member Functions inherited from Deveel.Data.Sql.Parser.SqlNode
virtual void OnNodeInit ()
 After the initialization of the node from the parser, this method is invoked to let the specific initialization to occur. More...
 

Package Functions

 ColumnConstraintNode ()
 

Properties

string ConstraintType [get, private set]
 
IExpressionNode CheckExpression [get, private set]
 
ObjectNameNode ReferencedTable [get, private set]
 
IdentifierNode ReferencedColumn [get, private set]
 
string OnDeleteAction [get, private set]
 
string OnUpdateAction [get, private set]
 
- Properties inherited from Deveel.Data.Sql.Parser.SqlNode
ISqlNode Parent [get, private set]
 Gets the parent of the current node. More...
 
string NodeName [get, private set]
 Gets the name of the node, as expressed in the SQL grammar. More...
 
IEnumerable< ISqlNodeChildNodes [get, private set]
 Gets an immutable list of nodes, children of the current node. More...
 
IEnumerable< TokenTokens [get, private set]
 Gets an immutable list of Token that represent the source of this node. More...
 
string ISqlNode. NodeName [get]
 
ISqlNode ISqlNode. Parent [get]
 
IEnumerable< ISqlNode > ISqlNode. ChildNodes [get]
 
IEnumerable< Token > ISqlNode. Tokens [get]
 
- Properties inherited from Deveel.Data.Sql.Parser.ISqlNode
string NodeName [get]
 Gets the name of the node analyzed from the parser. More...
 
ISqlNode Parent [get]
 Gets a reference to the parent ISqlNode, if any. More...
 
IEnumerable< ISqlNodeChildNodes [get]
 Gets a read-only enumeration of the children nodes, if any. More...
 
IEnumerable< TokenTokens [get]
 Gets an enumeration of the tokens composing the this node. More...
 

Private Attributes

bool notSeen
 

Additional Inherited Members

- Public Member Functions inherited from Deveel.Data.Sql.Parser.SqlNode
 SqlNode ()
 

Detailed Description

Definition at line 20 of file ColumnConstraintNode.cs.

Constructor & Destructor Documentation

Deveel.Data.Sql.Parser.ColumnConstraintNode.ColumnConstraintNode ( )
inlinepackage

Definition at line 23 of file ColumnConstraintNode.cs.

23  {
24  }

Member Function Documentation

override ISqlNode Deveel.Data.Sql.Parser.ColumnConstraintNode.OnChildNode ( ISqlNode  node)
inlineprotectedvirtual

During the initialization of the node from the parser, this method is called for every child node added to ChildNodes

Parameters
nodeThe node being added to the list of children.
Returns
Returns a normalized version of the child node, or the node itself.

Reimplemented from Deveel.Data.Sql.Parser.SqlNode.

Definition at line 38 of file ColumnConstraintNode.cs.

38  {
39  if (node is SqlKeyNode) {
40  var keyNode = (SqlKeyNode) node;
41  if (String.Equals(keyNode.Text, "NULL", StringComparison.OrdinalIgnoreCase)) {
42  if (notSeen) {
43  ConstraintType = ConstraintTypeNames.NotNull;
44  } else {
45  ConstraintType = ConstraintTypeNames.Null;
46  }
47  } else if (String.Equals(keyNode.Text, "NOT", StringComparison.OrdinalIgnoreCase)) {
48  notSeen = true;
49  } else if (String.Equals(keyNode.Text, "REFERENCES", StringComparison.OrdinalIgnoreCase)) {
50  ConstraintType = ConstraintTypeNames.ForeignKey;
51  } else if (String.Equals(keyNode.Text, "CHECK", StringComparison.OrdinalIgnoreCase)) {
52  ConstraintType = ConstraintTypeNames.Check;
53  } else if (String.Equals(keyNode.Text, "PRIMARY", StringComparison.OrdinalIgnoreCase)) {
54  ConstraintType = ConstraintTypeNames.PrimaryKey;
55  } else if (String.Equals(keyNode.Text, "UNIQUE", StringComparison.OrdinalIgnoreCase)) {
56  ConstraintType = ConstraintTypeNames.UniqueKey;
57  }
58  } else if (node is IExpressionNode) {
59  CheckExpression = (IExpressionNode) node;
60  } else if (node is ObjectNameNode) {
61  if (!String.Equals(ConstraintType, ConstraintTypeNames.ForeignKey, StringComparison.OrdinalIgnoreCase))
62  throw new InvalidOperationException();
63 
64  ReferencedTable = ((ObjectNameNode) node);
65  }
66 
67  return base.OnChildNode(node);
68  }
A long string in the system.
override ISqlNode OnChildNode(ISqlNode node)
During the initialization of the node from the parser, this method is called for every child node add...

Member Data Documentation

bool Deveel.Data.Sql.Parser.ColumnConstraintNode.notSeen
private

Definition at line 21 of file ColumnConstraintNode.cs.

Property Documentation

IExpressionNode Deveel.Data.Sql.Parser.ColumnConstraintNode.CheckExpression
getprivate set

Definition at line 28 of file ColumnConstraintNode.cs.

string Deveel.Data.Sql.Parser.ColumnConstraintNode.ConstraintType
getprivate set

Definition at line 26 of file ColumnConstraintNode.cs.

string Deveel.Data.Sql.Parser.ColumnConstraintNode.OnDeleteAction
getprivate set

Definition at line 34 of file ColumnConstraintNode.cs.

string Deveel.Data.Sql.Parser.ColumnConstraintNode.OnUpdateAction
getprivate set

Definition at line 36 of file ColumnConstraintNode.cs.

IdentifierNode Deveel.Data.Sql.Parser.ColumnConstraintNode.ReferencedColumn
getprivate set

Definition at line 32 of file ColumnConstraintNode.cs.

ObjectNameNode Deveel.Data.Sql.Parser.ColumnConstraintNode.ReferencedTable
getprivate set

Definition at line 30 of file ColumnConstraintNode.cs.


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