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.QueryExpressionFrom.FromExpressionPreparer Class Reference
Inheritance diagram for Deveel.Data.Sql.Query.QueryExpressionFrom.FromExpressionPreparer:
Deveel.Data.Sql.Expressions.IExpressionPreparer

Public Member Functions

 FromExpressionPreparer (QueryExpressionFrom fromSet)
 
bool CanPrepare (SqlExpression expression)
 Verifies whether the instance of the interface can prepare the given expression. More...
 
SqlExpression Prepare (SqlExpression expression)
 Returns the new translated object to be mutated from the given expression. More...
 

Private Attributes

readonly QueryExpressionFrom fromSet
 

Detailed Description

Definition at line 314 of file QueryExpressionFrom.cs.

Constructor & Destructor Documentation

Deveel.Data.Sql.Query.QueryExpressionFrom.FromExpressionPreparer.FromExpressionPreparer ( QueryExpressionFrom  fromSet)
inline

Definition at line 317 of file QueryExpressionFrom.cs.

317  {
318  this.fromSet = fromSet;
319  }

Member Function Documentation

bool Deveel.Data.Sql.Query.QueryExpressionFrom.FromExpressionPreparer.CanPrepare ( SqlExpression  expression)
inline

Verifies whether the instance of the interface can prepare the given expression.

Parameters
expressionThe expression object to verify.
Returns
Returns true if this preparer will prepare the given object in an expression.

Implements Deveel.Data.Sql.Expressions.IExpressionPreparer.

Definition at line 321 of file QueryExpressionFrom.cs.

321  {
322  return expression is SqlReferenceExpression;
323  }
An expression that references an object within a context.
SqlExpression Deveel.Data.Sql.Query.QueryExpressionFrom.FromExpressionPreparer.Prepare ( SqlExpression  expression)
inline

Returns the new translated object to be mutated from the given expression.

Parameters
expression
Returns

Implements Deveel.Data.Sql.Expressions.IExpressionPreparer.

Definition at line 325 of file QueryExpressionFrom.cs.

325  {
326  var refName = ((SqlReferenceExpression) expression).ReferenceName;
327 
328  var reference = fromSet.QualifyReference(refName);
329  if (reference is ObjectName)
330  return SqlExpression.Reference((ObjectName) reference);
331  if (reference is QueryReference)
332  return new QueryReferenceExpression((QueryReference) reference);
333 
334  throw new InvalidOperationException();
335  }
An expression that references an object within a context.
static SqlReferenceExpression Reference(ObjectName objectName)
Defines the base class for instances that represent SQL expression tree nodes.

Member Data Documentation

readonly QueryExpressionFrom Deveel.Data.Sql.Query.QueryExpressionFrom.FromExpressionPreparer.fromSet
private

Definition at line 315 of file QueryExpressionFrom.cs.


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