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.SqlQueryExpressionNode Class Reference

The root node of an expression used to select a set of items from a set of sources defined, given some conditions specified. More...

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

 SqlQueryExpressionNode ()
 

Properties

bool IsAll [get, private set]
 Gets a boolean value indicating if the selection will return all columns from the sources specified in FromClause. More...
 
bool IsDistinct [get, private set]
 Gets a boolean value indicating if the selection will return only results that are unique. More...
 
SqlReferenceExpressionNode IntoClause [get, private set]
 
IEnumerable< SelectItemNodeSelectItems [get, private set]
 Gets a read-only list of items that will be returned by the query. More...
 
FromClauseNode FromClause [get, private set]
 Gets the clause defining the sources from where to query. More...
 
IExpressionNode WhereExpression [get, private set]
 Gets an optional clause that is used to filter the queried objects. More...
 
GroupByNode GroupBy [get, private set]
 Gets an optional clause used to group and filter the results of a query. More...
 
QueryCompositeNode Composite [get, private set]
 Gets an optional definition for a composition between this query and another. More...
 
- 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 GetWhereClause (ISqlNode node)
 
void GetRestrict (ISqlNode node)
 
void GetSelectSet (ISqlNode node)
 
void GetSelectItems (ISqlNode node)
 

Additional Inherited Members

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

Detailed Description

The root node of an expression used to select a set of items from a set of sources defined, given some conditions specified.

Definition at line 26 of file SqlQueryExpressionNode.cs.

Constructor & Destructor Documentation

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

Definition at line 27 of file SqlQueryExpressionNode.cs.

27  {
28  }

Member Function Documentation

void Deveel.Data.Sql.Parser.SqlQueryExpressionNode.GetRestrict ( ISqlNode  node)
inlineprivate

Definition at line 107 of file SqlQueryExpressionNode.cs.

107  {
108  foreach (var childNode in node.ChildNodes) {
109  if (childNode is SqlKeyNode) {
110  var value = ((SqlKeyNode) childNode).Text;
111  if (value == "ALL") {
112  IsAll = true;
113  } else if (value == "DISTINCT") {
114  IsDistinct = true;
115  }
116  }
117  }
118  }
bool IsAll
Gets a boolean value indicating if the selection will return all columns from the sources specified i...
bool IsDistinct
Gets a boolean value indicating if the selection will return only results that are unique...
void Deveel.Data.Sql.Parser.SqlQueryExpressionNode.GetSelectItems ( ISqlNode  node)
inlineprivate

Definition at line 131 of file SqlQueryExpressionNode.cs.

131  {
132  var items = new List<SelectItemNode>();
133  foreach (var childNode in node.ChildNodes) {
134  if (childNode is SelectItemNode)
135  items.Add((SelectItemNode)childNode);
136  }
137 
138  SelectItems = items.ToArray();
139  }
IEnumerable< SelectItemNode > SelectItems
Gets a read-only list of items that will be returned by the query.
void Deveel.Data.Sql.Parser.SqlQueryExpressionNode.GetSelectSet ( ISqlNode  node)
inlineprivate

Definition at line 120 of file SqlQueryExpressionNode.cs.

120  {
121  foreach (var childNode in node.ChildNodes) {
122  if (childNode is SqlKeyNode &&
123  ((SqlKeyNode) childNode).Text == "*") {
124  IsAll = true;
125  } else if (childNode.NodeName == "select_item_list") {
126  GetSelectItems(childNode);
127  }
128  }
129  }
bool IsAll
Gets a boolean value indicating if the selection will return all columns from the sources specified i...
void Deveel.Data.Sql.Parser.SqlQueryExpressionNode.GetWhereClause ( ISqlNode  node)
inlineprivate

Definition at line 98 of file SqlQueryExpressionNode.cs.

98  {
99  foreach (var childNode in node.ChildNodes) {
100  if (childNode is IExpressionNode) {
101  WhereExpression = childNode as IExpressionNode;
102  break;
103  }
104  }
105  }
IExpressionNode WhereExpression
Gets an optional clause that is used to filter the queried objects.
override ISqlNode Deveel.Data.Sql.Parser.SqlQueryExpressionNode.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 74 of file SqlQueryExpressionNode.cs.

74  {
75  if (node.NodeName == "select_restrict_opt") {
76  GetRestrict(node);
77  } else if (node.NodeName == "select_set") {
78  GetSelectSet(node);
79  } else if (node.NodeName == "from_clause_opt") {
80  var clause = node.ChildNodes.FirstOrDefault();
81  if (clause != null)
82  FromClause = (FromClauseNode) clause;
83  } else if (node.NodeName == "where_clause_opt") {
84  GetWhereClause(node);
85  } else if (node.NodeName == "group_by_opt") {
86  GroupBy = node.ChildNodes.FirstOrDefault() as GroupByNode;
87  } else if (node.NodeName == "query_composite_opt") {
88  var composite = node.ChildNodes.FirstOrDefault();
89  if (composite != null)
90  Composite = (QueryCompositeNode) composite;
91  } else if (node.NodeName == "select_into_opt") {
92  // TODO:
93  }
94 
95  return base.OnChildNode(node);
96  }
IEnumerable< ISqlNode > ChildNodes
Gets an immutable list of nodes, children of the current node.
Definition: SqlNode.cs:55
GroupByNode GroupBy
Gets an optional clause used to group and filter the results of a query.
override ISqlNode OnChildNode(ISqlNode node)
During the initialization of the node from the parser, this method is called for every child node add...
FromClauseNode FromClause
Gets the clause defining the sources from where to query.
QueryCompositeNode Composite
Gets an optional definition for a composition between this query and another.

Property Documentation

QueryCompositeNode Deveel.Data.Sql.Parser.SqlQueryExpressionNode.Composite
getprivate set

Gets an optional definition for a composition between this query and another.

See also
QueryCompositeNode

Definition at line 71 of file SqlQueryExpressionNode.cs.

FromClauseNode Deveel.Data.Sql.Parser.SqlQueryExpressionNode.FromClause
getprivate set

Gets the clause defining the sources from where to query.

Definition at line 53 of file SqlQueryExpressionNode.cs.

GroupByNode Deveel.Data.Sql.Parser.SqlQueryExpressionNode.GroupBy
getprivate set

Gets an optional clause used to group and filter the results of a query.

Definition at line 64 of file SqlQueryExpressionNode.cs.

SqlReferenceExpressionNode Deveel.Data.Sql.Parser.SqlQueryExpressionNode.IntoClause
getprivate set

Definition at line 42 of file SqlQueryExpressionNode.cs.

bool Deveel.Data.Sql.Parser.SqlQueryExpressionNode.IsAll
getprivate set

Gets a boolean value indicating if the selection will return all columns from the sources specified in FromClause.

Definition at line 34 of file SqlQueryExpressionNode.cs.

bool Deveel.Data.Sql.Parser.SqlQueryExpressionNode.IsDistinct
getprivate set

Gets a boolean value indicating if the selection will return only results that are unique.

Definition at line 40 of file SqlQueryExpressionNode.cs.

IEnumerable<SelectItemNode> Deveel.Data.Sql.Parser.SqlQueryExpressionNode.SelectItems
getprivate set

Gets a read-only list of items that will be returned by the query.

Definition at line 48 of file SqlQueryExpressionNode.cs.

IExpressionNode Deveel.Data.Sql.Parser.SqlQueryExpressionNode.WhereExpression
getprivate set

Gets an optional clause that is used to filter the queried objects.

Definition at line 58 of file SqlQueryExpressionNode.cs.


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