WhereExpression Class

From RemObjects Wiki

Jump to:navigation, search
.NET Platform Header-48.png

This is a Data Abstract for .NET Library topic

Please do not modify the page structure, but feel free to modify/add text.

ClassesProtocolsEnums

Contents

Overview

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


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

For example, a WHERE part of this query

SELECT * FROM Employees WHERE ((Position = 'Sales Manager') 
OR (Zip IS NULL)) AND (City IN ('Atlanta GA', 'Seattle WA', 'New York CA'))

will be presented as:

WhereExpression lResult;
lResult = new BinaryExpression(new BinaryExpression(
            new BinaryExpression(
              new FieldExpression("Position"),
              new ConstantExpression("Sales Manager", DataType.String),BinaryOperator.Equal),
              new BinaryExpression(
              new FieldExpression("Zip"),
              new NullExpression(),BinaryOperator.Equal),BinaryOperator.Or),

              new BinaryExpression(
                new FieldExpression("City"),
                new ListExpression(
                new WhereExpression[]{ new ConstantExpression("Atlanta GA",DataType.String),
                                   new ConstantExpression("Seattle WA", DataType.String),
                                   new ConstantExpression("New York CA", DataType.String) }),
             BinaryOperator.In),

           BinaryOperator.And);


Location


Properties

Kind

Abstract readonly property, which represents the type of WHERE expression in the descendant class.


Prism:   property Kind: WhereKind read
C#:   WhereKind Kind { get; }
VB:   Property ReadOnly Kind As WhereKind


Class Methods

Combine (WhereExpression, WhereExpression): WhereExpression

Creates new BinaryExpression from given aLeft and aRight operands, using operator And.


Prism:   class method Combine(aLeft: WhereExpression; aRight: WhereExpression): WhereExpression
C#:   static WhereExpression Combine(WhereExpression aLeft, WhereExpression aRight)
VB:   Shared Function Combine(aLeft As WhereExpression, aRight As WhereExpression) As WhereExpression


Parameters:

  • aLeft:
  • aRight:


Combine (WhereExpression, WhereExpression, BinaryOperator): WhereExpression


Prism:   class method Combine(aLeft: WhereExpression; aRight: WhereExpression; anOperator: BinaryOperator): WhereExpression
C#:   static WhereExpression Combine(WhereExpression aLeft, WhereExpression aRight, BinaryOperator anOperator)
VB:   Shared Function Combine(aLeft As WhereExpression, aRight As WhereExpression, anOperator As BinaryOperator) As WhereExpression


Parameters:

  • aLeft:
  • aRight:
  • anOperator:


FromString

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


Prism:   class method FromString(aXml: String): WhereExpression
C#:   static WhereExpression FromString(String aXml)
VB:   Shared Function FromString(aXml As String) As WhereExpression


Parameters:

  • aXml:


FromXmlNode

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


Prism:   class method FromXmlNode(aNode: XmlNode): WhereExpression
C#:   static WhereExpression FromXmlNode(XmlNode aNode)
VB:   Shared Function FromXmlNode(aNode As XmlNode) As WhereExpression


Parameters:

  • aNode:


Validate

Validates that WhereExpression doesn't contain any errors, using WhereValidator. The main purpose of this validation - to scan all objects of WhereExpession tree and make sure that it contains correct field names. Validates that WhereExpression doesn't contain any errors, using WhereValidator. The main purpose of this validation - to scan all objects of WhereExpession tree and make sure that it contains correct field names.


Prism:   class method Validate(anExpression: WhereExpression): Boolean
C#:   static Boolean Validate(WhereExpression anExpression)
VB:   Shared Function Validate(anExpression As WhereExpression) As Boolean


Parameters:

  • anExpression:



Instance Methods

constructor


Prism:   constructor
C#:   constructor()
VB:   Sub New


ApplyFieldMapping

Adjusts the field names in the WhereExpression in accordance with table names of fields in the given schema column mapping.


Prism:   method ApplyFieldMapping(aColumnMappings: SchemaColumnMappingCollection)
C#:   void ApplyFieldMapping(SchemaColumnMappingCollection aColumnMappings)
VB:   Sub ApplyFieldMapping(aColumnMappings As SchemaColumnMappingCollection)


Parameters:

  • aColumnMappings:


ApplyTableNameOrAlias


Prism:   method ApplyTableNameOrAlias(aName: String)
C#:   void ApplyTableNameOrAlias(String aName)
VB:   Sub ApplyTableNameOrAlias(aName As String)


Parameters:

  • aName:


ExtractAllConstantExpression

Establishes a list of all ConstantExpression contained in the WhereExpression.


Prism:   method ExtractAllConstantExpression(aExprList: List<ConstantExpression>)
C#:   void ExtractAllConstantExpression(List<ConstantExpression> aExprList)
VB:   Sub ExtractAllConstantExpression(aExprList As List<ConstantExpression>)


Parameters:

  • aExprList:


ExtractAllFieldNames

Establishes a list of field names used in the WhereExpression.


Prism:   method ExtractAllFieldNames(aFieldNames: List<String>)
C#:   void ExtractAllFieldNames(List<String> aFieldNames)
VB:   Sub ExtractAllFieldNames(aFieldNames As List<String>)


Parameters:

  • aFieldNames:


ExtractAllParams

Fills SchemaParameterCollection with ParameterExpressions and ConstantExpressions (as ParameterExpressions) contained in the WhereExpression.


Prism:   method ExtractAllParams(aParameters: SchemaParameterCollection)
C#:   void ExtractAllParams(SchemaParameterCollection aParameters)
VB:   Sub ExtractAllParams(aParameters As SchemaParameterCollection)


Parameters:

  • aParameters:


ReadFromXml

Abstract method. In descendants creates WhereExpression from the given xml node, that should be in the correct Dynamic Where XML Format.


Prism:   method ReadFromXml(xr: XmlNode)
C#:   void ReadFromXml(XmlNode xr)
VB:   Sub ReadFromXml(xr As XmlNode)


Parameters:

  • xr:


ToSQLString ()


Prism:   method ToSQLString
C#:   String ToSQLString()
VB:   Function ToSQLString


ToSQLString (StringBuilder)


Prism:   method ToSQLString(dest: StringBuilder)
C#:   void ToSQLString(StringBuilder dest)
VB:   Sub ToSQLString(dest As StringBuilder)


Parameters:

  • dest:


ToXmlNode

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


Prism:   method ToXmlNode
C#:   XmlNode ToXmlNode()
VB:   Function ToXmlNode


ToXmlString

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


Prism:   method ToXmlString
C#:   String ToXmlString()
VB:   Function ToXmlString


Validate


Prism:   method Validate
C#:   Boolean Validate()
VB:   Function Validate


WriteToXml

Abstract method. In descendants creates where node (in the Dynamic Where XML Format) from WhereExpression.


Prism:   method WriteToXml(sw: XmlNode)
C#:   void WriteToXml(XmlNode sw)
VB:   Sub WriteToXml(sw As XmlNode)


Parameters:

  • sw:



See Also


Da-48.png

Product: RemObjects Data Abstract
Available Editions: Data Abstract for .NET, Delphi and Xcode

GlossaryArchitectureArticlesFeaturesLibrarySamples

Navigation
products
hubs
special
Toolbox