Grooper.CMIS.ComparisonPredicate
Specifies search criteria for an individual property, using a comparison between the property value and a constant.
The comparison predicate takes the general form PropertyName Operator Value, where
PropertyName is the Query Name of a property, Operator
is one of the operators from the table below, and Value is a constant value against which
the property should be compared.
Valid Operators
Below is a list of operators which can be used in a comparison.
Operator | Description | Comments |
---|
= | Equal to | Valid on all property types. |
<> | Not equal to | Valid on all property types. |
< | Less than | Valid on numeric and date/time property types. |
> | Greater than | Valid on numeric and date/time property types. |
<= | Less than or equal to | Valid on numeric and date/time property types. |
>= | Greater than or equal to | Valid on numeric and date/time property types. |
LIKE | Contains a substring | Valid on string types only. See 'LIKE Operator' section below for details. |
IS | IS NULL or IS NOT NULL | Valid on all property types. |
Examples by Property Type
The table below outlines the requirements of a comparison predicate for each type of property.
Property Type | Supported Operators | Quoted | Example |
---|
String | =, <>, LIKE, IS | Yes | vendor_name LIKE '%acme%' |
Decimal | =, <>, <, <=, >, >=, IS | No | invoice_amount <= 1000.00 |
Integer | =, <>, <, <=, >, >=, IS | No | quantity = 0 |
Boolean | =, IS | No | tax_exempt = true |
DateTime | =, <>, <, <=, >, >=, IS | Yes | invoice_date < '01/01/2018' |
ID | =, <>, IS | Yes | type_id='2fadac71-a9a9-4185-9070-e3b23517e518' |
URI | =, <>, LIKE, IS | Yes | vendor_website LIKE 'http://www.grooper.com/%' |
LIKE Operator
The LIKE operator specifies that a property value must contain a substring. It takes the general form PropertyName LIKE 'Expression',
where PropertyName is the query name of a string property, and Expression is a string
literal using the '%' and '_' characters as wildcards. The LIKE operator is not case sensitive.
The '%' wildcard substitutes for zero or more characters. The '_' wildcard substitutes for exactly one character. A LIKE expression with no wildcards is
equivalent to using the = operator. The expression 'grooper%' will match cases where the property value begins with
'grooper', while '%grooper' will match cases where the property value ends with 'grooper'. The expression
'grooper%review' will match cases where the property value begins with 'grooper' and ends with 'review'.
NOTE: Some CMIS Bindings have limited support for LIKE expressions, and will raise errors when unsupported features are used. Examples of such
issues are as follows:
- Some bindings only support the '%' wildcard at the beginning or end of the expression.
- Some bindings do not support the 'ends with' form of LIKE (i.e. '%grooper').
- Some bindings do not support the '_' wildcard at all.
Inherits from: Grooper.CMIS.WherePredicate
Constructors
Signature |
Description |
New (PropDef As IPropertyDefinition, CompOp As String, Value As String, Inverted As Boolean) |
Parameters |
PropDef |
Type: IPropertyDefinition |
|
|
CompOp |
Type: String |
|
|
Value |
Type: String |
|
|
Inverted |
Type: Boolean |
|
|
Fields
Field Name |
Field Type |
Description |
CompOp As System.String |
System.String |
|
Inverted As System.Boolean |
System.Boolean |
|
PropDef As PortCMIS.Data.IPropertyDefinition |
PortCMIS.Data.IPropertyDefinition |
|
Value As System.String |
System.String |
|
Properties
Property Name |
Property Type |
Description |
IsEmpty |
System.Boolean |
Returns true if all properties with a ViewableAttribute are set to their default value. |
IsWriteable |
System.Boolean |
Returns true if the object is writable, or false if it is not. |
Methods
Method Name |
Description |
GetInvertedValue(Value As Boolean) As Boolean |
Returns the inverse of the passed Boolean value, if this query element's Inverted property is True, otherwise the passed Boolean value is returned.
Parameters |
Value |
Type: Boolean |
|
|
GetProperties() As PropertyDescriptorCollection |
|
IsPropertyEnabled(PropertyName As String) As Nullable(Of Boolean) |
Defines whether a property is currently enabled.
Parameters |
PropertyName |
Type: String |
The name of the property to determine the enabled state for. |
|
IsPropertyVisible(PropertyName As String) As Nullable(Of Boolean) |
Defines whether a property is currently visible.
Parameters |
PropertyName |
Type: String |
The name of the property to determine the visible state for. |
|
IsType(Type As Type) As Boolean |
Returns true if the object is of the type specified, or if it derives from the type specfied.
Parameters |
Type |
Type: Type |
The type to check. |
|
ToString() As String |
|
ValidateProperties() As ValidationErrorList |
Validates the properties of the object, returning a list of validation errors. |