DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Protected Member Functions | Properties | List of all members
Deveel.Data.Sql.Parser.CreateSequenceNode Class Reference
Inheritance diagram for Deveel.Data.Sql.Parser.CreateSequenceNode:
Deveel.Data.Sql.Parser.SqlStatementNode Deveel.Data.Sql.Parser.SqlNode Deveel.Data.Sql.Parser.ISqlVisitableNode Deveel.Data.Sql.Parser.IStatementNode Deveel.Data.Sql.Parser.ISqlNode Deveel.Data.Sql.Parser.ISqlNode 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...
 
override void BuildStatement (StatementBuilder builder)
 
- 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...
 

Properties

string SequenceName [get, private set]
 
IExpressionNode IncrementBy [get, private set]
 
IExpressionNode MinValue [get, private set]
 
IExpressionNode MaxValue [get, private set]
 
IExpressionNode StartWith [get, private set]
 
bool Cycle [get, private set]
 
IExpressionNode Cache [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...
 

Additional Inherited Members

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

Detailed Description

Definition at line 8 of file CreateSequenceNode.cs.

Member Function Documentation

override void Deveel.Data.Sql.Parser.CreateSequenceNode.BuildStatement ( StatementBuilder  builder)
inlineprotectedvirtual

Implements Deveel.Data.Sql.Parser.SqlStatementNode.

Definition at line 43 of file CreateSequenceNode.cs.

43  {
44  var seqName = ObjectName.Parse(SequenceName);
45  var statement = new CreateSequenceStatement(seqName);
46 
47  if (IncrementBy != null)
48  statement.IncrementBy = ExpressionBuilder.Build(IncrementBy);
49  if (Cache != null)
50  statement.Cache = ExpressionBuilder.Build(Cache);
51  if (StartWith != null)
52  statement.StartWith = ExpressionBuilder.Build(StartWith);
53  if (MinValue != null)
54  statement.MinValue = ExpressionBuilder.Build(MinValue);
55  if (MaxValue != null)
56  statement.MaxValue = ExpressionBuilder.Build(MaxValue);
57 
58  statement.Cycle = Cycle;
59 
60  builder.Statements.Add(statement);
61  }
override ISqlNode Deveel.Data.Sql.Parser.CreateSequenceNode.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 23 of file CreateSequenceNode.cs.

23  {
24  if (node is ObjectNameNode) {
25  SequenceName = ((ObjectNameNode) node).Name;
26  } else if (node.NodeName.Equals("start_opt")) {
27  StartWith = node.FindNode<IExpressionNode>();
28  } else if (node.NodeName.Equals("increment_opt")) {
29  IncrementBy = node.FindNode<IExpressionNode>();
30  } else if (node.NodeName.Equals("minvalue_opt")) {
31  MinValue = node.FindNode<IExpressionNode>();
32  } else if (node.NodeName.Equals("maxvalue_opt")) {
33  MaxValue = node.FindNode<IExpressionNode>();
34  } else if (node.NodeName.Equals("cycle_opt")) {
35  Cycle = node.ChildNodes.Any();
36  } else if (node.NodeName.Equals("cache_opt")) {
37  Cache = node.FindNode<IExpressionNode>();
38  }
39 
40  return base.OnChildNode(node);
41  }

Property Documentation

IExpressionNode Deveel.Data.Sql.Parser.CreateSequenceNode.Cache
getprivate set

Definition at line 21 of file CreateSequenceNode.cs.

bool Deveel.Data.Sql.Parser.CreateSequenceNode.Cycle
getprivate set

Definition at line 19 of file CreateSequenceNode.cs.

IExpressionNode Deveel.Data.Sql.Parser.CreateSequenceNode.IncrementBy
getprivate set

Definition at line 11 of file CreateSequenceNode.cs.

IExpressionNode Deveel.Data.Sql.Parser.CreateSequenceNode.MaxValue
getprivate set

Definition at line 15 of file CreateSequenceNode.cs.

IExpressionNode Deveel.Data.Sql.Parser.CreateSequenceNode.MinValue
getprivate set

Definition at line 13 of file CreateSequenceNode.cs.

string Deveel.Data.Sql.Parser.CreateSequenceNode.SequenceName
getprivate set

Definition at line 9 of file CreateSequenceNode.cs.

IExpressionNode Deveel.Data.Sql.Parser.CreateSequenceNode.StartWith
getprivate set

Definition at line 17 of file CreateSequenceNode.cs.


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