BinaryExpression

Overview

The BinaryExpression class is derived from the WhereExpression class and represents logical operations like And, Or, Greater Than etc.

Like other classes derived from WhereExpression, this one is used to represent conditions in Data Abstract data requests.

For example, the WHERE clause in this query:

SELECT * FROM Employees WHERE (ID=42)

can be transformed to:

WhereExpression where = new BinaryExpression(
                          new FieldExpression("ID"), 
                          new ConstantExpression(42), 
                          BinaryOperator.Equal);

Location

 

constructor

Creates a new instance of the BinaryExpression class.

 

constructor

 

BinaryExpression()

 

Sub New

constructor (array of BinaryExpression, BinaryOperator)

 

constructor(expressions: array of BinaryExpression; operator: BinaryOperator)

 

BinaryExpression(BinaryExpression[] expressions, BinaryOperator operator)

 

Sub New (expressions As array of BinaryExpression, operator As BinaryOperator)

Parameters:

  • expressions:
  • operator:

constructor (WhereExpression, Object, BinaryOperator)

 

constructor(left: WhereExpression; value: Object; operator: BinaryOperator)

 

BinaryExpression(WhereExpression left, Object value, BinaryOperator operator)

 

Sub New (left As WhereExpression, value As Object, operator As BinaryOperator)

Parameters:

  • left:
  • value:
  • operator:

 

constructor(left: WhereExpression; right: WhereExpression; operator: BinaryOperator)

 

BinaryExpression(WhereExpression left, WhereExpression right, BinaryOperator operator)

 

Sub New (left As WhereExpression, right As WhereExpression, operator As BinaryOperator)

Parameters:

  • left:
  • right:
  • operator:

ApplyFieldMapping

 

method ApplyFieldMapping(columnMappings: SchemaColumnMappingCollection)

 

void ApplyFieldMapping(SchemaColumnMappingCollection columnMappings)

 

Sub ApplyFieldMapping(columnMappings As SchemaColumnMappingCollection)

Parameters:

  • columnMappings:

ApplySourceTableNumber

 

method ApplySourceTableNumber(number: Int32): WhereExpression

 

WhereExpression ApplySourceTableNumber(Int32 number)

 

Function ApplySourceTableNumber(number As Int32) As WhereExpression

Parameters:

  • number:

ApplyTableMapping

 

method ApplyTableMapping(schemaTable: String; databaseTable: String)

 

void ApplyTableMapping(String schemaTable, String databaseTable)

 

Sub ApplyTableMapping(schemaTable As String, databaseTable As String)

Parameters:

  • schemaTable:
  • databaseTable:

ApplyTableNameOrAlias

 

method ApplyTableNameOrAlias(name: String)

 

void ApplyTableNameOrAlias(String name)

 

Sub ApplyTableNameOrAlias(name As String)

Parameters:

  • name:

 

class method Combine(left: WhereExpression; right: WhereExpression): WhereExpression

 

static WhereExpression Combine(WhereExpression left, WhereExpression right)

 

Shared Function Combine(left As WhereExpression, right As WhereExpression) As WhereExpression

Parameters:

  • left:
  • right:

 

class method Combine(left: WhereExpression; right: WhereExpression; operator: BinaryOperator): WhereExpression

 

static WhereExpression Combine(WhereExpression left, WhereExpression right, BinaryOperator operator)

 

Shared Function Combine(left As WhereExpression, right As WhereExpression, operator As BinaryOperator) As WhereExpression

Parameters:

  • left:
  • right:
  • operator:

ExtractAllConstantExpression

 

method ExtractAllConstantExpression(expressions: List<ConstantExpression>)

 

void ExtractAllConstantExpression(List<ConstantExpression> expressions)

 

Sub ExtractAllConstantExpression(expressions As List<ConstantExpression>)

Parameters:

  • expressions:

ExtractAllFieldNames

 

method ExtractAllFieldNames(fieldNames: List<String>)

 

void ExtractAllFieldNames(List<String> fieldNames)

 

Sub ExtractAllFieldNames(fieldNames As List<String>)

Parameters:

  • fieldNames:

ExtractAllParams

 

method ExtractAllParams(parameters: SchemaParameterCollection)

 

void ExtractAllParams(SchemaParameterCollection parameters)

 

Sub ExtractAllParams(parameters As SchemaParameterCollection)

Parameters:

  • parameters:

FromString    (declared in WhereExpression)

Creates new WhereExpression from string, which should contain where node in the correct Dynamic Where XML Format.

 

class method FromString(xml: String): WhereExpression

 

static WhereExpression FromString(String xml)

 

Shared Function FromString(xml As String) As WhereExpression

Parameters:

  • xml:

FromStringToSql    (declared in WhereExpression)

 

class method FromStringToSql(xml: String): String

 

static String FromStringToSql(String xml)

 

Shared Function FromStringToSql(xml As String) As String

Parameters:

  • xml:

FromXmlNode    (declared in WhereExpression)

Creates new WhereExpression from xml node, which should be in the correct Dynamic Where XML Format.

 

class method FromXmlNode(node: XmlNode): WhereExpression

 

static WhereExpression FromXmlNode(XmlNode node)

 

Shared Function FromXmlNode(node As XmlNode) As WhereExpression

Parameters:

  • node:

Kind

The kind of the current binary expression. Equals WhereKind.Binary.

 

property Kind: WhereKind read;

 

WhereKind Kind { get; }

 

Property ReadOnly Kind As WhereKind

Left

The left side of the binary expression.

 

property Left: WhereExpression read write;

 

WhereExpression Left { get; set; }

 

Property Left As WhereExpression

Operator

Represents the binary operator. It can be: addition, and, divide, =, >, in, <, <=, like, multiply, <>, or, subtraction, xor. Available types of BinaryExpression are defined by the BinaryOperator.

 

property Operator: BinaryOperator read write;

 

BinaryOperator Operator { get; set; }

 

Property Operator As BinaryOperator

ParseExpression    (declared in WhereExpression)

 

class method ParseExpression(node: XmlNode): WhereExpression

 

static WhereExpression ParseExpression(XmlNode node)

 

Shared Function ParseExpression(node As XmlNode) As WhereExpression

Parameters:

  • node:

ReadFromXml

Reads the new BinaryExpression from the XML node xr. The attribute operator in the xr contains the expression Operator. The first child element of xr contains the left side Left of the binary expression. The last child element of xr contains the right side Right of the binary expression. If the first or last child element are not recognized, the method raises an exception with an Element expected description.

 

method ReadFromXml(node: XmlNode)

 

void ReadFromXml(XmlNode node)

 

Sub ReadFromXml(node As XmlNode)

Parameters:

  • node:

Right

The right side of the expression.

 

property Right: WhereExpression read write;

 

WhereExpression Right { get; set; }

 

Property Right As WhereExpression

ToSQLString    (declared in WhereExpression)

A helper method that wraps the similar one with the string builder and returns a SQL string.

 

method ToSQLString: String

 

String ToSQLString()

 

Function ToSQLString As String

ToSQLString (StringBuilder)

Converts the current binary expression to the SQL string. The dest contains the result SQL string.

 

method ToSQLString(destination: StringBuilder)

 

void ToSQLString(StringBuilder destination)

 

Sub ToSQLString(destination As StringBuilder)

Parameters:

  • destination:

ToString    (declared in WhereExpression)

Returns a SQL string representation of the current expression.

 

method ToString: String

 

String ToString()

 

Function ToString As String

ToXmlNode    (declared in WhereExpression)

Creates query node (in the Dynamic Where XML Format) from WhereExpression.

 

method ToXmlNode: XmlNode

 

XmlNode ToXmlNode()

 

Function ToXmlNode As XmlNode

ToXmlString    (declared in WhereExpression)

Creates query node (in the Dynamic Where XML Format) from WhereExpression and returns it in the string format.

 

method ToXmlString: String

 

String ToXmlString()

 

Function ToXmlString As String

Validate    (declared in WhereExpression)

 

method Validate: Boolean

 

Boolean Validate()

 

Function Validate As Boolean

Validate (WhereExpression): Boolean    (declared in WhereExpression)

 

class method Validate(expression: WhereExpression): Boolean

 

static Boolean Validate(WhereExpression expression)

 

Shared Function Validate(expression As WhereExpression) As Boolean

Parameters:

  • expression:

WriteToXml

Writes the current BinaryExpression object to the XML node sw. The XML node sw contains the elements binaryoperation with the Left and Right side of the binary expression the with attribute operator, which contains the expression Operator.

 

method WriteToXml(node: XmlNode)

 

void WriteToXml(XmlNode node)

 

Sub WriteToXml(node As XmlNode)

Parameters:

  • node:

 

Kind

The kind of the current binary expression. Equals WhereKind.Binary.

 

property Kind: WhereKind read;

 

WhereKind Kind { get; }

 

Property ReadOnly Kind As WhereKind

Left

The left side of the binary expression.

 

property Left: WhereExpression read write;

 

WhereExpression Left { get; set; }

 

Property Left As WhereExpression

Operator

Represents the binary operator. It can be: addition, and, divide, =, >, in, <, <=, like, multiply, <>, or, subtraction, xor. Available types of BinaryExpression are defined by the BinaryOperator.

 

property Operator: BinaryOperator read write;

 

BinaryOperator Operator { get; set; }

 

Property Operator As BinaryOperator

Right

The right side of the expression.

 

property Right: WhereExpression read write;

 

WhereExpression Right { get; set; }

 

Property Right As WhereExpression

 

 

class method Combine(left: WhereExpression; right: WhereExpression): WhereExpression

 

static WhereExpression Combine(WhereExpression left, WhereExpression right)

 

Shared Function Combine(left As WhereExpression, right As WhereExpression) As WhereExpression

Parameters:

  • left:
  • right:

 

class method Combine(left: WhereExpression; right: WhereExpression; operator: BinaryOperator): WhereExpression

 

static WhereExpression Combine(WhereExpression left, WhereExpression right, BinaryOperator operator)

 

Shared Function Combine(left As WhereExpression, right As WhereExpression, operator As BinaryOperator) As WhereExpression

Parameters:

  • left:
  • right:
  • operator:

FromString    (declared in WhereExpression)

Creates new WhereExpression from string, which should contain where node in the correct Dynamic Where XML Format.

 

class method FromString(xml: String): WhereExpression

 

static WhereExpression FromString(String xml)

 

Shared Function FromString(xml As String) As WhereExpression

Parameters:

  • xml:

FromStringToSql    (declared in WhereExpression)

 

class method FromStringToSql(xml: String): String

 

static String FromStringToSql(String xml)

 

Shared Function FromStringToSql(xml As String) As String

Parameters:

  • xml:

FromXmlNode    (declared in WhereExpression)

Creates new WhereExpression from xml node, which should be in the correct Dynamic Where XML Format.

 

class method FromXmlNode(node: XmlNode): WhereExpression

 

static WhereExpression FromXmlNode(XmlNode node)

 

Shared Function FromXmlNode(node As XmlNode) As WhereExpression

Parameters:

  • node:

ParseExpression    (declared in WhereExpression)

 

class method ParseExpression(node: XmlNode): WhereExpression

 

static WhereExpression ParseExpression(XmlNode node)

 

Shared Function ParseExpression(node As XmlNode) As WhereExpression

Parameters:

  • node:

Validate (WhereExpression): Boolean    (declared in WhereExpression)

 

class method Validate(expression: WhereExpression): Boolean

 

static Boolean Validate(WhereExpression expression)

 

Shared Function Validate(expression As WhereExpression) As Boolean

Parameters:

  • expression:

 

constructor

Creates a new instance of the BinaryExpression class.

 

constructor

 

BinaryExpression()

 

Sub New

constructor (array of BinaryExpression, BinaryOperator)

 

constructor(expressions: array of BinaryExpression; operator: BinaryOperator)

 

BinaryExpression(BinaryExpression[] expressions, BinaryOperator operator)

 

Sub New (expressions As array of BinaryExpression, operator As BinaryOperator)

Parameters:

  • expressions:
  • operator:

constructor (WhereExpression, Object, BinaryOperator)

 

constructor(left: WhereExpression; value: Object; operator: BinaryOperator)

 

BinaryExpression(WhereExpression left, Object value, BinaryOperator operator)

 

Sub New (left As WhereExpression, value As Object, operator As BinaryOperator)

Parameters:

  • left:
  • value:
  • operator:

 

constructor(left: WhereExpression; right: WhereExpression; operator: BinaryOperator)

 

BinaryExpression(WhereExpression left, WhereExpression right, BinaryOperator operator)

 

Sub New (left As WhereExpression, right As WhereExpression, operator As BinaryOperator)

Parameters:

  • left:
  • right:
  • operator:

ApplyFieldMapping

 

method ApplyFieldMapping(columnMappings: SchemaColumnMappingCollection)

 

void ApplyFieldMapping(SchemaColumnMappingCollection columnMappings)

 

Sub ApplyFieldMapping(columnMappings As SchemaColumnMappingCollection)

Parameters:

  • columnMappings:

ApplySourceTableNumber

 

method ApplySourceTableNumber(number: Int32): WhereExpression

 

WhereExpression ApplySourceTableNumber(Int32 number)

 

Function ApplySourceTableNumber(number As Int32) As WhereExpression

Parameters:

  • number:

ApplyTableMapping

 

method ApplyTableMapping(schemaTable: String; databaseTable: String)

 

void ApplyTableMapping(String schemaTable, String databaseTable)

 

Sub ApplyTableMapping(schemaTable As String, databaseTable As String)

Parameters:

  • schemaTable:
  • databaseTable:

ApplyTableNameOrAlias

 

method ApplyTableNameOrAlias(name: String)

 

void ApplyTableNameOrAlias(String name)

 

Sub ApplyTableNameOrAlias(name As String)

Parameters:

  • name:

ExtractAllConstantExpression

 

method ExtractAllConstantExpression(expressions: List<ConstantExpression>)

 

void ExtractAllConstantExpression(List<ConstantExpression> expressions)

 

Sub ExtractAllConstantExpression(expressions As List<ConstantExpression>)

Parameters:

  • expressions:

ExtractAllFieldNames

 

method ExtractAllFieldNames(fieldNames: List<String>)

 

void ExtractAllFieldNames(List<String> fieldNames)

 

Sub ExtractAllFieldNames(fieldNames As List<String>)

Parameters:

  • fieldNames:

ExtractAllParams

 

method ExtractAllParams(parameters: SchemaParameterCollection)

 

void ExtractAllParams(SchemaParameterCollection parameters)

 

Sub ExtractAllParams(parameters As SchemaParameterCollection)

Parameters:

  • parameters:

ReadFromXml

Reads the new BinaryExpression from the XML node xr. The attribute operator in the xr contains the expression Operator. The first child element of xr contains the left side Left of the binary expression. The last child element of xr contains the right side Right of the binary expression. If the first or last child element are not recognized, the method raises an exception with an Element expected description.

 

method ReadFromXml(node: XmlNode)

 

void ReadFromXml(XmlNode node)

 

Sub ReadFromXml(node As XmlNode)

Parameters:

  • node:

ToSQLString    (declared in WhereExpression)

A helper method that wraps the similar one with the string builder and returns a SQL string.

 

method ToSQLString: String

 

String ToSQLString()

 

Function ToSQLString As String

ToSQLString (StringBuilder)

Converts the current binary expression to the SQL string. The dest contains the result SQL string.

 

method ToSQLString(destination: StringBuilder)

 

void ToSQLString(StringBuilder destination)

 

Sub ToSQLString(destination As StringBuilder)

Parameters:

  • destination:

ToString    (declared in WhereExpression)

Returns a SQL string representation of the current expression.

 

method ToString: String

 

String ToString()

 

Function ToString As String

ToXmlNode    (declared in WhereExpression)

Creates query node (in the Dynamic Where XML Format) from WhereExpression.

 

method ToXmlNode: XmlNode

 

XmlNode ToXmlNode()

 

Function ToXmlNode As XmlNode

ToXmlString    (declared in WhereExpression)

Creates query node (in the Dynamic Where XML Format) from WhereExpression and returns it in the string format.

 

method ToXmlString: String

 

String ToXmlString()

 

Function ToXmlString As String

Validate    (declared in WhereExpression)

 

method Validate: Boolean

 

Boolean Validate()

 

Function Validate As Boolean

WriteToXml

Writes the current BinaryExpression object to the XML node sw. The XML node sw contains the elements binaryoperation with the Left and Right side of the binary expression the with attribute operator, which contains the expression Operator.

 

method WriteToXml(node: XmlNode)

 

void WriteToXml(XmlNode node)

 

Sub WriteToXml(node As XmlNode)

Parameters:

  • node:

See Also

  • BinaryOperator
  • BinaryExpression Class:
    • RemObjects.DataAbstract.Expressions
    • RemObjects.DataAbstract.Server.Sql