C# Class Deveel.Data.Sql.Expressions.SqlExpression

Defines the base class for instances that represent SQL expression tree nodes.
The architecture of the SQL Expression domain is to keep the implementation internal to the project, that means it will be possible to construct expressions only through this class, calling factory methods (for example Binary).
Datei anzeigen Open project: deveel/deveeldb Class Usage Examples

Private Properties

Property Type Description
AppendTo void
Deserialize SqlExpression
ISerializable void
ISqlFormattable void
Parse SqlExpression
Serialize void
SqlExpression System
SqlExpression System
TryParse bool

Public Methods

Method Description
Accept ( SqlExpressionVisitor visitor ) : SqlExpression
Add ( SqlExpression left, SqlExpression right ) : SqlBinaryExpression
All ( SqlExpression value ) : SqlQuantifiedExpression
And ( SqlExpression left, SqlExpression right ) : SqlBinaryExpression
Any ( SqlExpression value ) : SqlQuantifiedExpression
Assign ( SqlExpression reference, SqlExpression valueExpression ) : SqlAssignExpression
Binary ( SqlExpression left, SqlExpressionType expressionType, SqlExpression right ) : SqlBinaryExpression
Cast ( SqlExpression value, SqlType destType ) : SqlCastExpression
Conditional ( SqlExpression testExpression, SqlExpression ifTrue ) : SqlConditionalExpression
Conditional ( SqlExpression testExpression, SqlExpression ifTrue, SqlExpression ifFalse ) : SqlConditionalExpression
Constant ( Field value ) : SqlConstantExpression
Constant ( object value ) : SqlConstantExpression
Divide ( SqlExpression left, SqlExpression right ) : SqlBinaryExpression
Equal ( SqlExpression left, SqlExpression right ) : SqlBinaryExpression
Evaluate ( ) : SqlExpression

Statically evaluates the expression, outside any context.

Evaluate ( EvaluateContext context ) : SqlExpression

When overridden by a derived class, this method evaluates the expression within the provided context.

This method is only executed is CanEvaluate is true, and the override method can reduce this expression to a simpler form.

Evaluate ( IRequest context, IVariableResolver variables ) : SqlExpression
Evaluate ( IRequest context, IVariableResolver variables, IGroupResolver group ) : SqlExpression
FunctionCall ( ObjectName functionName ) : SqlFunctionCallExpression
FunctionCall ( ObjectName functionName, InvokeArgument args ) : SqlFunctionCallExpression
FunctionCall ( ObjectName functionName, SqlExpression args ) : SqlFunctionCallExpression
FunctionCall ( string functionName ) : SqlFunctionCallExpression
FunctionCall ( string functionName, InvokeArgument args ) : SqlFunctionCallExpression
FunctionCall ( string functionName, SqlExpression args ) : SqlFunctionCallExpression
GreaterOrEqualThan ( SqlExpression left, SqlExpression right ) : SqlBinaryExpression
GreaterThan ( SqlExpression left, SqlExpression right ) : SqlBinaryExpression
Is ( SqlExpression left, SqlExpression right ) : SqlBinaryExpression
IsNot ( SqlExpression left, SqlExpression right ) : SqlBinaryExpression
Like ( SqlExpression left, SqlExpression right ) : SqlBinaryExpression
Modulo ( SqlExpression left, SqlExpression right ) : SqlBinaryExpression
Multiply ( SqlExpression left, SqlExpression right ) : SqlBinaryExpression
Negate ( SqlExpression operand ) : SqlUnaryExpression
Not ( SqlExpression operand ) : SqlUnaryExpression
NotEqual ( SqlExpression left, SqlExpression right ) : SqlBinaryExpression
NotLike ( SqlExpression left, SqlExpression right ) : SqlBinaryExpression
Or ( SqlExpression left, SqlExpression right ) : SqlBinaryExpression
Parse ( string s ) : SqlExpression

Parses the given SQL string to an expression that can be evaluated.

Parse ( string s, IContext context ) : SqlExpression

Parses the given SQL string to an expression that can be evaluated.

Prepare ( IExpressionPreparer preparer ) : SqlExpression
Quantified ( SqlExpressionType expressionType, SqlExpression value ) : SqlQuantifiedExpression
Reference ( ObjectName objectName ) : SqlReferenceExpression
SmallerOrEqualThan ( SqlExpression left, SqlExpression right ) : SqlBinaryExpression
SmallerThan ( SqlExpression left, SqlExpression right ) : SqlBinaryExpression
Subtract ( SqlExpression left, SqlExpression right ) : SqlBinaryExpression
ToString ( ) : string
TryParse ( string s, IExpressionParser parser, SqlExpression &expression ) : bool
Tuple ( SqlExpression expressions ) : SqlTupleExpression
Tuple ( SqlExpression expr1, SqlExpression exp2 ) : SqlTupleExpression
Tuple ( SqlExpression expr1, SqlExpression expr2, SqlExpression expr3 ) : SqlTupleExpression
Unary ( SqlExpressionType expressionType, SqlExpression operand ) : SqlUnaryExpression
UnaryPlus ( SqlExpression operand ) : SqlUnaryExpression
VariableReference ( string varName ) : SqlVariableReferenceExpression
XOr ( SqlExpression left, SqlExpression right ) : SqlBinaryExpression

Protected Methods

Method Description
GetData ( SerializationInfo info, StreamingContext context ) : void

Private Methods

Method Description
AppendTo ( SqlStringBuilder builder ) : void
Deserialize ( BinaryReader reader ) : SqlExpression
ISerializable ( SerializationInfo info, StreamingContext context ) : void
ISqlFormattable ( SqlStringBuilder builder ) : void
Parse ( string s, IExpressionParser parser ) : SqlExpression
Serialize ( SqlExpression expression, BinaryWriter writer ) : void
SqlExpression ( ) : System

Internally constructs the SQL expression, avoiding external implementations to be allowed to inherit this class.

SqlExpression ( SerializationInfo info, StreamingContext context ) : System
TryParse ( string s, IExpressionParser parser, SqlExpression &expression, Exception &error ) : bool

Method Details

Accept() public method

public Accept ( SqlExpressionVisitor visitor ) : SqlExpression
visitor SqlExpressionVisitor
return SqlExpression

Add() public static method

public static Add ( SqlExpression left, SqlExpression right ) : SqlBinaryExpression
left SqlExpression
right SqlExpression
return SqlBinaryExpression

All() public static method

public static All ( SqlExpression value ) : SqlQuantifiedExpression
value SqlExpression
return SqlQuantifiedExpression

And() public static method

public static And ( SqlExpression left, SqlExpression right ) : SqlBinaryExpression
left SqlExpression
right SqlExpression
return SqlBinaryExpression

Any() public static method

public static Any ( SqlExpression value ) : SqlQuantifiedExpression
value SqlExpression
return SqlQuantifiedExpression

Assign() public static method

public static Assign ( SqlExpression reference, SqlExpression valueExpression ) : SqlAssignExpression
reference SqlExpression
valueExpression SqlExpression
return SqlAssignExpression

Binary() public static method

public static Binary ( SqlExpression left, SqlExpressionType expressionType, SqlExpression right ) : SqlBinaryExpression
left SqlExpression
expressionType SqlExpressionType
right SqlExpression
return SqlBinaryExpression

Cast() public static method

public static Cast ( SqlExpression value, SqlType destType ) : SqlCastExpression
value SqlExpression
destType SqlType
return SqlCastExpression

Conditional() public static method

public static Conditional ( SqlExpression testExpression, SqlExpression ifTrue ) : SqlConditionalExpression
testExpression SqlExpression
ifTrue SqlExpression
return SqlConditionalExpression

Conditional() public static method

public static Conditional ( SqlExpression testExpression, SqlExpression ifTrue, SqlExpression ifFalse ) : SqlConditionalExpression
testExpression SqlExpression
ifTrue SqlExpression
ifFalse SqlExpression
return SqlConditionalExpression

Constant() public static method

public static Constant ( Field value ) : SqlConstantExpression
value Field
return SqlConstantExpression

Constant() public static method

public static Constant ( object value ) : SqlConstantExpression
value object
return SqlConstantExpression

Divide() public static method

public static Divide ( SqlExpression left, SqlExpression right ) : SqlBinaryExpression
left SqlExpression
right SqlExpression
return SqlBinaryExpression

Equal() public static method

public static Equal ( SqlExpression left, SqlExpression right ) : SqlBinaryExpression
left SqlExpression
right SqlExpression
return SqlBinaryExpression

Evaluate() public method

Statically evaluates the expression, outside any context.
/// If any error occurred while evaluating the expression. ///
public Evaluate ( ) : SqlExpression
return SqlExpression

Evaluate() public method

When overridden by a derived class, this method evaluates the expression within the provided context.

This method is only executed is CanEvaluate is true, and the override method can reduce this expression to a simpler form.

/// If any error occurred while evaluating the expression. ///
public Evaluate ( EvaluateContext context ) : SqlExpression
context EvaluateContext The context for the evaluation of the expression, providing /// access to the system or to the execution context.
return SqlExpression

Evaluate() public method

public Evaluate ( IRequest context, IVariableResolver variables ) : SqlExpression
context IRequest
variables IVariableResolver
return SqlExpression

Evaluate() public method

public Evaluate ( IRequest context, IVariableResolver variables, IGroupResolver group ) : SqlExpression
context IRequest
variables IVariableResolver
group IGroupResolver
return SqlExpression

FunctionCall() public static method

public static FunctionCall ( ObjectName functionName ) : SqlFunctionCallExpression
functionName ObjectName
return SqlFunctionCallExpression

FunctionCall() public static method

public static FunctionCall ( ObjectName functionName, InvokeArgument args ) : SqlFunctionCallExpression
functionName ObjectName
args InvokeArgument
return SqlFunctionCallExpression

FunctionCall() public static method

public static FunctionCall ( ObjectName functionName, SqlExpression args ) : SqlFunctionCallExpression
functionName ObjectName
args SqlExpression
return SqlFunctionCallExpression

FunctionCall() public static method

public static FunctionCall ( string functionName ) : SqlFunctionCallExpression
functionName string
return SqlFunctionCallExpression

FunctionCall() public static method

public static FunctionCall ( string functionName, InvokeArgument args ) : SqlFunctionCallExpression
functionName string
args InvokeArgument
return SqlFunctionCallExpression

FunctionCall() public static method

public static FunctionCall ( string functionName, SqlExpression args ) : SqlFunctionCallExpression
functionName string
args SqlExpression
return SqlFunctionCallExpression

GetData() protected method

protected GetData ( SerializationInfo info, StreamingContext context ) : void
info SerializationInfo
context StreamingContext
return void

GreaterOrEqualThan() public static method

public static GreaterOrEqualThan ( SqlExpression left, SqlExpression right ) : SqlBinaryExpression
left SqlExpression
right SqlExpression
return SqlBinaryExpression

GreaterThan() public static method

public static GreaterThan ( SqlExpression left, SqlExpression right ) : SqlBinaryExpression
left SqlExpression
right SqlExpression
return SqlBinaryExpression

Is() public static method

public static Is ( SqlExpression left, SqlExpression right ) : SqlBinaryExpression
left SqlExpression
right SqlExpression
return SqlBinaryExpression

IsNot() public static method

public static IsNot ( SqlExpression left, SqlExpression right ) : SqlBinaryExpression
left SqlExpression
right SqlExpression
return SqlBinaryExpression

Like() public static method

public static Like ( SqlExpression left, SqlExpression right ) : SqlBinaryExpression
left SqlExpression
right SqlExpression
return SqlBinaryExpression

Modulo() public static method

public static Modulo ( SqlExpression left, SqlExpression right ) : SqlBinaryExpression
left SqlExpression
right SqlExpression
return SqlBinaryExpression

Multiply() public static method

public static Multiply ( SqlExpression left, SqlExpression right ) : SqlBinaryExpression
left SqlExpression
right SqlExpression
return SqlBinaryExpression

Negate() public static method

public static Negate ( SqlExpression operand ) : SqlUnaryExpression
operand SqlExpression
return SqlUnaryExpression

Not() public static method

public static Not ( SqlExpression operand ) : SqlUnaryExpression
operand SqlExpression
return SqlUnaryExpression

NotEqual() public static method

public static NotEqual ( SqlExpression left, SqlExpression right ) : SqlBinaryExpression
left SqlExpression
right SqlExpression
return SqlBinaryExpression

NotLike() public static method

public static NotLike ( SqlExpression left, SqlExpression right ) : SqlBinaryExpression
left SqlExpression
right SqlExpression
return SqlBinaryExpression

Or() public static method

public static Or ( SqlExpression left, SqlExpression right ) : SqlBinaryExpression
left SqlExpression
right SqlExpression
return SqlBinaryExpression

Parse() public static method

Parses the given SQL string to an expression that can be evaluated.
public static Parse ( string s ) : SqlExpression
s string The string to parse.
return SqlExpression

Parse() public static method

Parses the given SQL string to an expression that can be evaluated.
public static Parse ( string s, IContext context ) : SqlExpression
s string The string to parse.
context IContext
return SqlExpression

Prepare() public method

public Prepare ( IExpressionPreparer preparer ) : SqlExpression
preparer IExpressionPreparer
return SqlExpression

Quantified() public static method

public static Quantified ( SqlExpressionType expressionType, SqlExpression value ) : SqlQuantifiedExpression
expressionType SqlExpressionType
value SqlExpression
return SqlQuantifiedExpression

Reference() public static method

public static Reference ( ObjectName objectName ) : SqlReferenceExpression
objectName ObjectName
return SqlReferenceExpression

SmallerOrEqualThan() public static method

public static SmallerOrEqualThan ( SqlExpression left, SqlExpression right ) : SqlBinaryExpression
left SqlExpression
right SqlExpression
return SqlBinaryExpression

SmallerThan() public static method

public static SmallerThan ( SqlExpression left, SqlExpression right ) : SqlBinaryExpression
left SqlExpression
right SqlExpression
return SqlBinaryExpression

Subtract() public static method

public static Subtract ( SqlExpression left, SqlExpression right ) : SqlBinaryExpression
left SqlExpression
right SqlExpression
return SqlBinaryExpression

ToString() public method

public ToString ( ) : string
return string

TryParse() public static method

public static TryParse ( string s, IExpressionParser parser, SqlExpression &expression ) : bool
s string
parser IExpressionParser
expression SqlExpression
return bool

Tuple() public static method

public static Tuple ( SqlExpression expressions ) : SqlTupleExpression
expressions SqlExpression
return SqlTupleExpression

Tuple() public static method

public static Tuple ( SqlExpression expr1, SqlExpression exp2 ) : SqlTupleExpression
expr1 SqlExpression
exp2 SqlExpression
return SqlTupleExpression

Tuple() public static method

public static Tuple ( SqlExpression expr1, SqlExpression expr2, SqlExpression expr3 ) : SqlTupleExpression
expr1 SqlExpression
expr2 SqlExpression
expr3 SqlExpression
return SqlTupleExpression

Unary() public static method

public static Unary ( SqlExpressionType expressionType, SqlExpression operand ) : SqlUnaryExpression
expressionType SqlExpressionType
operand SqlExpression
return SqlUnaryExpression

UnaryPlus() public static method

public static UnaryPlus ( SqlExpression operand ) : SqlUnaryExpression
operand SqlExpression
return SqlUnaryExpression

VariableReference() public static method

public static VariableReference ( string varName ) : SqlVariableReferenceExpression
varName string
return SqlVariableReferenceExpression

XOr() public static method

public static XOr ( SqlExpression left, SqlExpression right ) : SqlBinaryExpression
left SqlExpression
right SqlExpression
return SqlBinaryExpression