FieldExpression

Overview

This class implements the FieldExpression and is used to represent table fields in Dynamic Where expressions. For example, see how the table field ID is represented in the SQL query WHERE clause and in the equal Dynamic Where expression:

SELECT * FROM Employees WHERE (ID=42)
WhereExpression where = new BinaryExpression(
                          new FieldExpression("ID"), 
                          new ConstantExpression(42), 
                          BinaryOperator.Equal);

Location

 

constructor

Creates a new instance of the FieldExpression class. Note that you have to set at least the FieldName property to be able to use this instance in Dynamic Where expressions.

 

constructor

 

FieldExpression()

constructor (String)

Creates a new instance of the FieldExpression class with the given field name.

 

constructor(aFieldName: String)

 

FieldExpression(String aFieldName)

Parameters:

  • aFieldName: The specified name of the field.

constructor (String, String)

Creates a new instance of the FieldExpression class with the given field name and table name.

 

constructor(aTableName: String; aFieldName: String)

 

FieldExpression(String aTableName, String aFieldName)

Parameters:

  • aTableName: The specified name of the table.
  • aFieldName: The specified name of the field.

Creates a new BinaryExpression from the given aLeft and aRight operands using BinaryOperator.

 

class method combine(aLeft: WhereExpression; aRight: WhereExpression): WhereExpression

 

static WhereExpression combine(WhereExpression aLeft, WhereExpression aRight)

Parameters:

  • aLeft: The left operand to be combined.
  • aRight: The right operand to be combined.

Creates a new BinaryExpression from the given aLeft and aRight operands using the given operator.

 

class method combine(aLeft: WhereExpression; aRight: WhereExpression; anOperator: BinaryOperator): WhereExpression

 

static WhereExpression combine(WhereExpression aLeft, WhereExpression aRight, BinaryOperator anOperator)

Parameters:

  • aLeft: The left operand to be combined.
  • aRight: The right operand to be combined.
  • anOperator: The operator to be used in combining.

FieldName

 

property FieldName: String read write;

 

String FieldName { __get; __set; }

fromString    (declared in WhereExpression)

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

 

class method fromString(anXml: String): WhereExpression

 

static WhereExpression fromString(String anXml)

Parameters:

  • anXml: The given XML string.

fromStringToSql    (declared in WhereExpression)

A helper method to convert a XML string into SQL string.

 

class method fromStringToSql(anXml: String): String

 

static String fromStringToSql(String anXml)

Parameters:

  • anXml: The XML string to be converted.

fromXmlNode    (declared in WhereExpression)

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

 

class method fromXmlNode(aNode: Node): WhereExpression

 

static WhereExpression fromXmlNode(Node aNode)

Parameters:

  • aNode: The XML node to be parsed.

Kind

 

property Kind: WhereKind read;

 

WhereKind Kind { __get; }

parseExpression    (declared in WhereExpression)

 

class method parseExpression(node: Node): WhereExpression

 

static WhereExpression parseExpression(Node node)

Parameters:

  • node:

readFromXml

Initializes the current ListExpression from the given XML node.

 

method readFromXml(aNode: Node)

 

void readFromXml(Node aNode)

Parameters:

  • aNode: The node that contains the serialized expression.

TableName

 

property TableName: String read write;

 

String TableName { __get; __set; }

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()

toSqlString (StringBuilder)    (declared in WhereExpression)

Creates an SQL representation of thу current where expression instance and appends it to the provided StringBuilder.

 

method toSqlString(aDestination: StringBuilder)

 

void toSqlString(StringBuilder aDestination)

Parameters:

  • aDestination: The destination string builder to be appended.

toSqlString (StringBuilder)

Creates an SQL representation of this FieldExpression instance and appends it to the provided StringBuilder.

For example, this method call

(new FieldExpression("ClassName")).ToSQLString(someStringBuilder)

will result in appending the string "ClassName" to someStringBuilder.

 

method toSqlString(destination: StringBuilder)

 

void toSqlString(StringBuilder destination)

Parameters:

  • destination: The destination string builder that will contain the string representation of the field.

toString    (declared in WhereExpression)

Returns a SQL string representation of the current expression.

 

method toString: String

 

String toString()

toXmlNode    (declared in WhereExpression)

Creates a query node (in the Dynamic Where XML Format) from the current expression.

 

method toXmlNode: Node

 

Node toXmlNode()

toXmlString    (declared in WhereExpression)

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

 

method toXmlString: String

 

String toXmlString()

validate    (declared in WhereExpression)

Validates the current expression with the WhereValidator and returns TRUE if it contains no errors. The main purpose of the validation is to scan all objects of WhereExpession tree and make sure that they contain correct field names.

 

method validate: Boolean

 

Boolean validate()

validate (WhereExpression): Boolean    (declared in WhereExpression)

Validates the provided WhereExpression with the WhereValidator and returns TRUE if it contains no errors. The main purpose of the validation is to scan all objects of WhereExpession tree and make sure that it contains correct field names.

 

class method validate(anExpression: WhereExpression): Boolean

 

static Boolean validate(WhereExpression anExpression)

Parameters:

  • anExpression: The expression to be validated.

writeToXml

Creates Xml node (in the Dynamic Where XML Format) from the current FieldExpression and appends it to the given parent node.

 

method writeToXml(aNode: Node)

 

void writeToXml(Node aNode)

Parameters:

  • aNode: The parent XML node.

 

FieldName

 

property FieldName: String read write;

 

String FieldName { __get; __set; }

Kind

 

property Kind: WhereKind read;

 

WhereKind Kind { __get; }

TableName

 

property TableName: String read write;

 

String TableName { __get; __set; }

 

Creates a new BinaryExpression from the given aLeft and aRight operands using BinaryOperator.

 

class method combine(aLeft: WhereExpression; aRight: WhereExpression): WhereExpression

 

static WhereExpression combine(WhereExpression aLeft, WhereExpression aRight)

Parameters:

  • aLeft: The left operand to be combined.
  • aRight: The right operand to be combined.

Creates a new BinaryExpression from the given aLeft and aRight operands using the given operator.

 

class method combine(aLeft: WhereExpression; aRight: WhereExpression; anOperator: BinaryOperator): WhereExpression

 

static WhereExpression combine(WhereExpression aLeft, WhereExpression aRight, BinaryOperator anOperator)

Parameters:

  • aLeft: The left operand to be combined.
  • aRight: The right operand to be combined.
  • anOperator: The operator to be used in combining.

fromString    (declared in WhereExpression)

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

 

class method fromString(anXml: String): WhereExpression

 

static WhereExpression fromString(String anXml)

Parameters:

  • anXml: The given XML string.

fromStringToSql    (declared in WhereExpression)

A helper method to convert a XML string into SQL string.

 

class method fromStringToSql(anXml: String): String

 

static String fromStringToSql(String anXml)

Parameters:

  • anXml: The XML string to be converted.

fromXmlNode    (declared in WhereExpression)

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

 

class method fromXmlNode(aNode: Node): WhereExpression

 

static WhereExpression fromXmlNode(Node aNode)

Parameters:

  • aNode: The XML node to be parsed.

parseExpression    (declared in WhereExpression)

 

class method parseExpression(node: Node): WhereExpression

 

static WhereExpression parseExpression(Node node)

Parameters:

  • node:

validate (WhereExpression): Boolean    (declared in WhereExpression)

Validates the provided WhereExpression with the WhereValidator and returns TRUE if it contains no errors. The main purpose of the validation is to scan all objects of WhereExpession tree and make sure that it contains correct field names.

 

class method validate(anExpression: WhereExpression): Boolean

 

static Boolean validate(WhereExpression anExpression)

Parameters:

  • anExpression: The expression to be validated.

 

constructor

Creates a new instance of the FieldExpression class. Note that you have to set at least the FieldName property to be able to use this instance in Dynamic Where expressions.

 

constructor

 

FieldExpression()

constructor (String)

Creates a new instance of the FieldExpression class with the given field name.

 

constructor(aFieldName: String)

 

FieldExpression(String aFieldName)

Parameters:

  • aFieldName: The specified name of the field.

constructor (String, String)

Creates a new instance of the FieldExpression class with the given field name and table name.

 

constructor(aTableName: String; aFieldName: String)

 

FieldExpression(String aTableName, String aFieldName)

Parameters:

  • aTableName: The specified name of the table.
  • aFieldName: The specified name of the field.

readFromXml

Initializes the current ListExpression from the given XML node.

 

method readFromXml(aNode: Node)

 

void readFromXml(Node aNode)

Parameters:

  • aNode: The node that contains the serialized expression.

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()

toSqlString (StringBuilder)    (declared in WhereExpression)

Creates an SQL representation of thу current where expression instance and appends it to the provided StringBuilder.

 

method toSqlString(aDestination: StringBuilder)

 

void toSqlString(StringBuilder aDestination)

Parameters:

  • aDestination: The destination string builder to be appended.

toSqlString (StringBuilder)

Creates an SQL representation of this FieldExpression instance and appends it to the provided StringBuilder.

For example, this method call

(new FieldExpression("ClassName")).ToSQLString(someStringBuilder)

will result in appending the string "ClassName" to someStringBuilder.

 

method toSqlString(destination: StringBuilder)

 

void toSqlString(StringBuilder destination)

Parameters:

  • destination: The destination string builder that will contain the string representation of the field.

toString    (declared in WhereExpression)

Returns a SQL string representation of the current expression.

 

method toString: String

 

String toString()

toXmlNode    (declared in WhereExpression)

Creates a query node (in the Dynamic Where XML Format) from the current expression.

 

method toXmlNode: Node

 

Node toXmlNode()

toXmlString    (declared in WhereExpression)

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

 

method toXmlString: String

 

String toXmlString()

validate    (declared in WhereExpression)

Validates the current expression with the WhereValidator and returns TRUE if it contains no errors. The main purpose of the validation is to scan all objects of WhereExpession tree and make sure that they contain correct field names.

 

method validate: Boolean

 

Boolean validate()

writeToXml

Creates Xml node (in the Dynamic Where XML Format) from the current FieldExpression and appends it to the given parent node.

 

method writeToXml(aNode: Node)

 

void writeToXml(Node aNode)

Parameters:

  • aNode: The parent XML node.