DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Public Member Functions | Private Attributes | List of all members
Deveel.Data.Sql.Query.QueryExpressionExtensions.ReferenceDiscovery Class Reference
Inheritance diagram for Deveel.Data.Sql.Query.QueryExpressionExtensions.ReferenceDiscovery:
Deveel.Data.Sql.Expressions.SqlExpressionVisitor

Public Member Functions

 ReferenceDiscovery ()
 
IEnumerable< ObjectNameDiscover (SqlExpression expression)
 
override SqlExpression VisitConstant (SqlConstantExpression constant)
 
override SqlExpression VisitFunctionCall (SqlFunctionCallExpression expression)
 Visits the expression that calls the function defined. More...
 
override SqlExpression VisitReference (SqlReferenceExpression reference)
 
- Public Member Functions inherited from Deveel.Data.Sql.Expressions.SqlExpressionVisitor
virtual SqlExpression Visit (SqlExpression expression)
 Visits a given SQL expression. More...
 
virtual SqlExpression[] VisitExpressionList (SqlExpression[] list)
 Visits a list of expressions given. More...
 
virtual SqlExpression VisitBinary (SqlBinaryExpression binaryEpression)
 
virtual SqlExpression VisitUnary (SqlUnaryExpression unary)
 
virtual SqlExpression VisitCast (SqlCastExpression castExpression)
 
virtual SqlExpression VisitVariableReference (SqlVariableReferenceExpression reference)
 
virtual SqlExpression VisitAssign (SqlAssignExpression assign)
 
virtual SqlExpression VisitConditional (SqlConditionalExpression conditional)
 
virtual SqlExpression VisitTuple (SqlTupleExpression expression)
 
virtual SqlExpression VisitQuery (SqlQueryExpression query)
 

Private Attributes

readonly List< ObjectNamecolumnNames
 

Detailed Description

Definition at line 53 of file QueryExpressionExtensions.cs.

Constructor & Destructor Documentation

Deveel.Data.Sql.Query.QueryExpressionExtensions.ReferenceDiscovery.ReferenceDiscovery ( )
inline

Definition at line 56 of file QueryExpressionExtensions.cs.

56  {
57  columnNames = new List<ObjectName>();
58  }

Member Function Documentation

IEnumerable<ObjectName> Deveel.Data.Sql.Query.QueryExpressionExtensions.ReferenceDiscovery.Discover ( SqlExpression  expression)
inline

Definition at line 60 of file QueryExpressionExtensions.cs.

60  {
61  Visit(expression);
62  return columnNames.ToArray();
63  }
virtual SqlExpression Visit(SqlExpression expression)
Visits a given SQL expression.
override SqlExpression Deveel.Data.Sql.Query.QueryExpressionExtensions.ReferenceDiscovery.VisitConstant ( SqlConstantExpression  constant)
inlinevirtual

Parameters
constant
Returns

Reimplemented from Deveel.Data.Sql.Expressions.SqlExpressionVisitor.

Definition at line 65 of file QueryExpressionExtensions.cs.

65  {
66  var value = constant.Value;
67  if (value.Type is ArrayType) {
68  var array = (SqlArray) value.Value;
69  foreach (var element in array) {
70  columnNames.AddRange(element.DiscoverReferences());
71  }
72  }
73 
74  return base.VisitConstant(constant);
75  }
ISqlObject Value
Gets the underlined value that is handled.
Definition: DataObject.cs:84
DataObject Value
Gets the constant value of the expression.
An object that provides methods for accessing a finite collection of SQL expressions.
Definition: SqlArray.cs:28
override SqlExpression Deveel.Data.Sql.Query.QueryExpressionExtensions.ReferenceDiscovery.VisitFunctionCall ( SqlFunctionCallExpression  expression)
inlinevirtual

Visits the expression that calls the function defined.

Parameters
expressionThe SqlFunctionCallExpression to visit.
Returns

Reimplemented from Deveel.Data.Sql.Expressions.SqlExpressionVisitor.

Definition at line 77 of file QueryExpressionExtensions.cs.

77  {
78  var args = expression.Arguments;
79  foreach (var arg in args) {
80  columnNames.AddRange(arg.DiscoverReferences());
81  }
82 
83  return base.VisitFunctionCall(expression);
84  }
override SqlExpression Deveel.Data.Sql.Query.QueryExpressionExtensions.ReferenceDiscovery.VisitReference ( SqlReferenceExpression  reference)
inlinevirtual

Parameters
reference
Returns

Reimplemented from Deveel.Data.Sql.Expressions.SqlExpressionVisitor.

Definition at line 86 of file QueryExpressionExtensions.cs.

86  {
87  columnNames.Add(reference.ReferenceName);
88  return base.VisitReference(reference);
89  }
ObjectName ReferenceName
Gets the name of the object referenced by the expression.

Member Data Documentation

readonly List<ObjectName> Deveel.Data.Sql.Query.QueryExpressionExtensions.ReferenceDiscovery.columnNames
private

Definition at line 54 of file QueryExpressionExtensions.cs.


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