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.QueryPlanner.VariableReplacer Class Reference
Inheritance diagram for Deveel.Data.Sql.Query.QueryPlanner.VariableReplacer:
Deveel.Data.Sql.Expressions.SqlExpressionVisitor

Public Member Functions

 VariableReplacer (IEnumerable< SelectColumn > selectColumns)
 
override SqlExpression VisitVariableReference (SqlVariableReferenceExpression reference)
 
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 VisitFunctionCall (SqlFunctionCallExpression expression)
 Visits the expression that calls the function defined. More...
 
virtual SqlExpression VisitBinary (SqlBinaryExpression binaryEpression)
 
virtual SqlExpression VisitUnary (SqlUnaryExpression unary)
 
virtual SqlExpression VisitCast (SqlCastExpression castExpression)
 
virtual SqlExpression VisitAssign (SqlAssignExpression assign)
 
virtual SqlExpression VisitConstant (SqlConstantExpression constant)
 
virtual SqlExpression VisitConditional (SqlConditionalExpression conditional)
 
virtual SqlExpression VisitTuple (SqlTupleExpression expression)
 
virtual SqlExpression VisitQuery (SqlQueryExpression query)
 

Private Attributes

readonly IEnumerable< SelectColumnselectColumns
 

Detailed Description

Definition at line 664 of file QueryPlanner.cs.

Constructor & Destructor Documentation

Deveel.Data.Sql.Query.QueryPlanner.VariableReplacer.VariableReplacer ( IEnumerable< SelectColumn selectColumns)
inline

Definition at line 667 of file QueryPlanner.cs.

667  {
669  }
readonly IEnumerable< SelectColumn > selectColumns

Member Function Documentation

override SqlExpression Deveel.Data.Sql.Query.QueryPlanner.VariableReplacer.VisitReference ( SqlReferenceExpression  reference)
inlinevirtual

Parameters
reference
Returns

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

Definition at line 676 of file QueryPlanner.cs.

676  {
677  var refName = reference.ReferenceName;
678  foreach (var column in selectColumns) {
679  if (refName.Equals(column.ResolvedName))
680  return SqlExpression.Reference(column.InternalName);
681  }
682 
683  return base.VisitReference(reference);
684  }
ObjectName ReferenceName
Gets the name of the object referenced by the expression.
readonly IEnumerable< SelectColumn > selectColumns
static SqlReferenceExpression Reference(ObjectName objectName)
Defines the base class for instances that represent SQL expression tree nodes.
override SqlExpression Deveel.Data.Sql.Query.QueryPlanner.VariableReplacer.VisitVariableReference ( SqlVariableReferenceExpression  reference)
inlinevirtual

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

Definition at line 671 of file QueryPlanner.cs.

671  {
672  // TODO: should we also resolve variables?
673  return base.VisitVariableReference(reference);
674  }

Member Data Documentation

readonly IEnumerable<SelectColumn> Deveel.Data.Sql.Query.QueryPlanner.VariableReplacer.selectColumns
private

Definition at line 665 of file QueryPlanner.cs.


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