Representation of a $filter expression for an OData entity type.
Create a representation of a filter expression for a given entity type. It can be rendered as value for the $filter system query option.
new sap.ui.model.analytics.odata4analytics.FilterExpression(oModel, oSchema, oEntityType)
Param | Type | Default Value | Description |
---|---|---|---|
oModel | object | datajs object for the OData model containing this entity type |
|
oSchema | object | datajs object for the schema containing this entity type |
|
oEntityType | sap.ui.model.analytics.odata4analytics.EntityType | object for the entity type |
Method | Description |
---|---|
addCondition |
Add a condition to the filter expression. Multiple conditions on the same property are combined with a logical OR first, and in a second step conditions for different properties are combined with a logical AND. |
addSetCondition |
Add a set condition to the filter expression. A set condition tests if the value of a property is included in a set of given values. It is a convenience method for this particular use case eliminating the need for multiple API calls. |
addUI5FilterConditions |
Add an array of UI5 filter conditions to the filter expression. The UI5 filter condition is combined with the other given conditions using a logical AND. This method is particularly useful for passing forward already created UI5 filter arrays. |
checkValidity |
Check if request is compliant with basic filter constraints expressed in metadata: (a) all properties required in the filter expression have been referenced (b) the single-value filter restrictions have been obeyed |
clear |
Clear expression from any conditions that may have been set previously |
getEntityType |
Get description for this entity type |
getExpressionAsUI5FilterArray |
Get an array of SAPUI5 Filter objects corresponding to this expression. |
getURIFilterOptionValue |
Get the value for the OData system query option $filter corresponding to this expression. |
removeConditions |
Remove all conditions for some property from the filter expression. All previously set conditions for some property are removed from the filter expression. |
Add a condition to the filter expression.
Multiple conditions on the same property are combined with a logical OR first, and in a second step conditions for different properties are combined with a logical AND.
Param | Type | DefaultValue | Description |
---|---|---|---|
sPropertyName | string |
The name of the property bound in the condition |
|
sOperator | sap.ui.model.FilterOperator |
operator used for the condition |
|
oValue | object |
value to be used for this condition |
|
oValue2 | object |
(optional) as second value to be used for this condition |
Add a set condition to the filter expression.
A set condition tests if the value of a property is included in a set of given values. It is a convenience method for this particular use case eliminating the need for multiple API calls.
Param | Type | DefaultValue | Description |
---|---|---|---|
sPropertyName | string |
The name of the property bound in the condition |
|
aValues | array |
values defining the set |
Add an array of UI5 filter conditions to the filter expression.
The UI5 filter condition is combined with the other given conditions using a logical AND. This method is particularly useful for passing forward already created UI5 filter arrays.
Param | Type | DefaultValue | Description |
---|---|---|---|
aUI5Filter | sap.ui.model.Filter[] |
Array of UI5 filter objects |
Check if request is compliant with basic filter constraints expressed in metadata:
(a) all properties required in the filter expression have been referenced (b) the single-value filter restrictions have been obeyed
Get an array of SAPUI5 Filter objects corresponding to this expression.