TDAWhereExpression

Overview

The base abstract class for classes that represent WHERE expression tree nodes:

  • TDABetweenExpression represents expression that checks belonging to a range of values;
  • TDABinaryExpression combines two other expressions with a binary operator (such as equality or binary logical operators);
  • TDAConstantExpression - the constant values that appear in an expression are represented through objects of this class;
  • TDAFieldExpression represents the part of expression containing table field names;
  • TDAListExpression is a complex expression, represented by a list of expressions;
  • TDAMacroExpression represents a call to a macro function, which will be processed by Macro Processor.
  • TDANullExpression represents NULL values used in the expression;
  • TDAParameterExpression - the parameters (variables) of an expression are represented through objects of this class;
  • TDAUnaryExpression represents expressions, based in the application of a unary operator (like the change of sign or logical negation) to another, inner expression;

This class is used to dynamically build WHERE statements from code (Dynamic Where feature of Data Abstract).

Location

  • Unit: uDACore.pas


 

AsJson

Returns where expression in Json format

function AsJson: UnicodeString

AsXML

Returns where expression in XML format

function AsXML: UnicodeString

Clone  virtual abstract

function Clone: TDAWhereExpression

DoValidate  protected

Raised exception if aRaiseException is set

procedure DoValidate(aRaiseException: Boolean; aName: string)

Parameters:

  • aRaiseException: specifies should the exception be raised or not.
  • aName: Name of property

Kind

Specified kind of TDAWhereExpression

property Kind: TDAWhereKind read

ParseException  protected

Raises EDAWhereParseXmlException.

procedure ParseException(aName: string)

Parameters:

  • aName: property name.

ParseExpression (TROJSONObject, string): TDAWhereExpression  protected overload

Creates new Where expression from Json object.

function ParseExpression(aItem: TROJSONObject; aName: string): TDAWhereExpression

Parameters:

  • aItem: Json object
  • aName: Name of property

ParseExpression (IXmlNode, string): TDAWhereExpression  protected overload

Creates new Where expression from XML node.

function ParseExpression(xr: IXmlNode; aName: string): TDAWhereExpression

Parameters:

  • xr: source node.
  • aName: Name of property

ParseExpression (TROJSONObject): TDAWhereExpression  overload

Creates new Where expression from Json object.

class function ParseExpression(anItem: TROJSONObject): TDAWhereExpression

Parameters:

  • anItem: json object

ParseExpression (IXmlNode): TDAWhereExpression  overload

Creates new Where expression from XML node.

class function ParseExpression(xr: IXmlNode): TDAWhereExpression

Parameters:

  • xr: given XML node.

ReadFromJson  virtual abstract

Reads where expression from the Json.

procedure ReadFromJson(aItem: TROJSONObject)

Parameters:

  • aItem: Json object

ReadFromXml  virtual abstract

Reads where expression from the XML.

procedure ReadFromXml(xr: IXmlNode)

Parameters:

  • xr: source node

RemoveEmptyNodes

Removes empty XML nodes from given node

class procedure RemoveEmptyNodes(aNode: IXMLNode)

Parameters:

  • aNode: node

Validate  virtual

Validates properties of expression.

procedure Validate

WriteToJson  virtual

Writes where expression to the Json object.

procedure WriteToJson(aItem: TROJSONObject)

Parameters:

  • aItem: destination object

WriteToXml  virtual

Writes where expression to the XML node.

procedure WriteToXml(sw: IXmlNode)

Parameters:

  • sw: destination node

 

Kind

Specified kind of TDAWhereExpression

property Kind: TDAWhereKind read

 

ParseExpression (TROJSONObject): TDAWhereExpression  overload

Creates new Where expression from Json object.

class function ParseExpression(anItem: TROJSONObject): TDAWhereExpression

Parameters:

  • anItem: json object

ParseExpression (IXmlNode): TDAWhereExpression  overload

Creates new Where expression from XML node.

class function ParseExpression(xr: IXmlNode): TDAWhereExpression

Parameters:

  • xr: given XML node.

RemoveEmptyNodes

Removes empty XML nodes from given node

class procedure RemoveEmptyNodes(aNode: IXMLNode)

Parameters:

  • aNode: node

 

AsJson

Returns where expression in Json format

function AsJson: UnicodeString

AsXML

Returns where expression in XML format

function AsXML: UnicodeString

Clone  virtual abstract

function Clone: TDAWhereExpression

DoValidate  protected

Raised exception if aRaiseException is set

procedure DoValidate(aRaiseException: Boolean; aName: string)

Parameters:

  • aRaiseException: specifies should the exception be raised or not.
  • aName: Name of property

ParseException  protected

Raises EDAWhereParseXmlException.

procedure ParseException(aName: string)

Parameters:

  • aName: property name.

ParseExpression (TROJSONObject, string): TDAWhereExpression  protected overload

Creates new Where expression from Json object.

function ParseExpression(aItem: TROJSONObject; aName: string): TDAWhereExpression

Parameters:

  • aItem: Json object
  • aName: Name of property

ParseExpression (IXmlNode, string): TDAWhereExpression  protected overload

Creates new Where expression from XML node.

function ParseExpression(xr: IXmlNode; aName: string): TDAWhereExpression

Parameters:

  • xr: source node.
  • aName: Name of property

ReadFromJson  virtual abstract

Reads where expression from the Json.

procedure ReadFromJson(aItem: TROJSONObject)

Parameters:

  • aItem: Json object

ReadFromXml  virtual abstract

Reads where expression from the XML.

procedure ReadFromXml(xr: IXmlNode)

Parameters:

  • xr: source node

Validate  virtual

Validates properties of expression.

procedure Validate

WriteToJson  virtual

Writes where expression to the Json object.

procedure WriteToJson(aItem: TROJSONObject)

Parameters:

  • aItem: destination object

WriteToXml  virtual

Writes where expression to the XML node.

procedure WriteToXml(sw: IXmlNode)

Parameters:

  • sw: destination node