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

A node describing the JOIN between two sources within a query. More...

Inheritance diagram for Deveel.Data.Sql.Parser.JoinNode:
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

 JoinNode ()
 

Properties

IFromSourceNode Source [get, private set]
 
IExpressionNode OnExpression [get, private set]
 Gets the expression used as condition for creating the joined group in a query. More...
 
string JoinType [get, private set]
 Gets the type of join, as a string that will be operated between the two sources More...
 
JoinNode NextJoin [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 Member Functions

void GetJoinType (ISqlNode node)
 

Additional Inherited Members

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

Detailed Description

A node describing the JOIN between two sources within a query.

See also
IFromSourceNode

Definition at line 29 of file JoinNode.cs.

Constructor & Destructor Documentation

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

Definition at line 30 of file JoinNode.cs.

30  {
31  }

Member Function Documentation

void Deveel.Data.Sql.Parser.JoinNode.GetJoinType ( ISqlNode  node)
inlineprivate

Definition at line 80 of file JoinNode.cs.

80  {
81  var sb = new StringBuilder();
82  bool first = true;
83  foreach (var childNode in node.ChildNodes) {
84  if (!first)
85  sb.Append(" ");
86 
87  sb.Append(childNode.NodeName);
88  first = false;
89  }
90 
91  JoinType = sb.ToString();
92  }
JoinType
Enumerates the kind of group join in a selection query.
Definition: JoinType.cs:23
override ISqlNode Deveel.Data.Sql.Parser.JoinNode.OnChildNode ( ISqlNode  node)
inlineprotectedvirtual

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

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

Definition at line 62 of file JoinNode.cs.

62  {
63  if (node.NodeName == "join_type") {
64  GetJoinType(node);
65  } else if (node is IFromSourceNode) {
66  Source = (IFromSourceNode) node;
67  } else if (node.NodeName == "from_source") {
68  Source = (IFromSourceNode) node.ChildNodes.FirstOrDefault();
69  } else if (node.NodeName == "on_opt") {
70  OnExpression = node.FindNode<IExpressionNode>();
71  } else if (node.NodeName == "join_opt") {
72  var join = node.ChildNodes.FirstOrDefault();
73  if (join != null)
74  NextJoin = (JoinNode) join;
75  }
76 
77  return base.OnChildNode(node);
78  }
void GetJoinType(ISqlNode node)
Definition: JoinNode.cs:80
IEnumerable< ISqlNode > ChildNodes
Gets a read-only enumeration of the children nodes, if any.
Definition: ISqlNode.cs:39
IExpressionNode OnExpression
Gets the expression used as condition for creating the joined group in a query.
Definition: JoinNode.cs:43
override ISqlNode OnChildNode(ISqlNode node)
During the initialization of the node from the parser, this method is called for every child node add...
Definition: JoinNode.cs:62

Property Documentation

string Deveel.Data.Sql.Parser.JoinNode.JoinType
getprivate set

Gets the type of join, as a string that will be operated between the two sources

This value is null if the join is done naturally, otherwise it can be only one of INNER, OUTER, LEFT OUTER, RIGHT OUTER.

See also
Expressions.JoinType

Definition at line 57 of file JoinNode.cs.

JoinNode Deveel.Data.Sql.Parser.JoinNode.NextJoin
getprivate set

Definition at line 59 of file JoinNode.cs.

IExpressionNode Deveel.Data.Sql.Parser.JoinNode.OnExpression
getprivate set

Gets the expression used as condition for creating the joined group in a query.

This value can be null only if two sources are joined naturally, that means the condition is defined in the WHERE expression.

Definition at line 43 of file JoinNode.cs.

IFromSourceNode Deveel.Data.Sql.Parser.JoinNode.Source
getprivate set

Definition at line 33 of file JoinNode.cs.


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