UnaryExpression
Overview
The UnaryExpression class is derived from the WhereExpression class and contains one operand (an expression) and a unary operator.
Like other classes derived from the WhereExpression class, the UnaryExpression class is used to represent conditions in Data Abstract data requests.
For example, the WHERE clause in this query:
SELECT * FROM Workers WHERE WorkerFirstName not like 'M%';
can be transformed to:
WhereExpression lResult;
lResult = new UnaryExpression(new BinaryExpression(new FieldExpression("WorkerFirstName"),
new ConstantExpression("M%", DataType.String),
BinaryOperator.Like), UnaryOperator.Not);
Location
- Reference: com.remobjects.dataabstract.jar
- Package: com.remobjects.dataabstract.expressions
- Ancestry: Object | WhereExpression | UnaryExpression
constructor
Creates a new UnaryExpression object.
constructor
UnaryExpression()
constructor (WhereExpression, UnaryOperator)
Creates a new UnaryExpression object.
constructor(anExpression: WhereExpression; anOperator: UnaryOperator)
UnaryExpression(WhereExpression anExpression, UnaryOperator anOperator)
Parameters:
- anExpression: The specified operand expression.
- anOperator: The specified operator.
combine (WhereExpression, WhereExpression): WhereExpression (declared in WhereExpression)
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.
combine (WhereExpression, WhereExpression, BinaryOperator): WhereExpression (declared in WhereExpression)
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.
Expression
property Expression: WhereExpression read write;
WhereExpression Expression { __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
Operator
property Operator: UnaryOperator read write;
UnaryOperator Operator { __get; __set; }
parseExpression (declared in WhereExpression)
class method parseExpression(node: Node): WhereExpression
static WhereExpression parseExpression(Node node)
Parameters:
- node:
readFromXml
Creates a WhereExpression from the given XML node that should be in the correct Dynamic Where XML Format.
method readFromXml(aNode: Node)
void readFromXml(Node aNode)
Parameters:
- aNode: The given xml 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()
toSqlString (StringBuilder)
Converts a unary expression to its SQL representation.
method toSqlString(aDestination: StringBuilder)
void toSqlString(StringBuilder aDestination)
Parameters:
- aDestination: An instance of the string builder that aggregates the sql string.
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 a WHERE node (in the Dynamic Where XML Format) from the unary expression and appends it to the given parent node.
method writeToXml(aNode: Node)
void writeToXml(Node aNode)
Parameters:
- aNode: The given parent XML node.
Expression
property Expression: WhereExpression read write;
WhereExpression Expression { __get; __set; }
Kind
Operator
property Operator: UnaryOperator read write;
UnaryOperator Operator { __get; __set; }
combine (WhereExpression, WhereExpression): WhereExpression (declared in WhereExpression)
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.
combine (WhereExpression, WhereExpression, BinaryOperator): WhereExpression (declared in WhereExpression)
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 UnaryExpression object.
constructor
UnaryExpression()
constructor (WhereExpression, UnaryOperator)
Creates a new UnaryExpression object.
constructor(anExpression: WhereExpression; anOperator: UnaryOperator)
UnaryExpression(WhereExpression anExpression, UnaryOperator anOperator)
Parameters:
- anExpression: The specified operand expression.
- anOperator: The specified operator.
readFromXml
Creates a WhereExpression from the given XML node that should be in the correct Dynamic Where XML Format.
method readFromXml(aNode: Node)
void readFromXml(Node aNode)
Parameters:
- aNode: The given xml 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()
toSqlString (StringBuilder)
Converts a unary expression to its SQL representation.
method toSqlString(aDestination: StringBuilder)
void toSqlString(StringBuilder aDestination)
Parameters:
- aDestination: An instance of the string builder that aggregates the sql string.
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 a WHERE node (in the Dynamic Where XML Format) from the unary expression and appends it to the given parent node.
method writeToXml(aNode: Node)
void writeToXml(Node aNode)
Parameters:
- aNode: The given parent XML node.