Class sap.ui.model.analytics.odata4analytics.FilterExpressionModule: sap/ui/model/analytics/odata4analytics


Representation of a $filter expression for an OData entity type.

Constructor Summary
new sap.ui.model.analytics.odata4analytics.FilterExpression(oModel, oSchema, oEntityType)Create a representation of a filter expression for a given entity type.
Method Summary
addCondition(sPropertyName, sOperator, oValue, oValue2)Add a condition to the filter expression.
addSetCondition(sPropertyName, aValues)Add a set condition to the filter expression.
addUI5FilterConditions(aUI5Filter)Add an array of UI5 filter conditions to the filter expression.
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(sPropertyName)Remove all conditions for some property from the filter expression.
Constructor Detail
new sap.ui.model.analytics.odata4analytics.FilterExpression(oModel, oSchema, oEntityType)
Create a representation of a filter expression for a given entity type. It can be rendered as value for the $filter system query option.
Parameters:
{object}oModel DataJS object for the OData model containing this entity type
{object}oSchema DataJS object for the schema containing this entity type
{sap.ui.model.analytics.odata4analytics.EntityType}oEntityType object for the entity type
Method Detail
addCondition(sPropertyName, sOperator, oValue, oValue2): sap.ui.model.analytics.odata4analytics.FilterExpression
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.

Parameters:
{string}sPropertyName The name of the property bound in the condition
{sap.ui.model.FilterOperator}sOperator operator used for the condition
{object}oValue value to be used for this condition
{object}oValue2 (optional) as second value to be used for this condition
Exceptions:
Exception if the property is unknown or not filterable
Returns:
{sap.ui.model.analytics.odata4analytics.FilterExpression} This object for method chaining
addSetCondition(sPropertyName, aValues): sap.ui.model.analytics.odata4analytics.FilterExpression
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.

Parameters:
{string}sPropertyName The name of the property bound in the condition
{array}aValues values defining the set
Exceptions:
Exception if the property is unknown or not filterable
Returns:
{sap.ui.model.analytics.odata4analytics.FilterExpression} This object for method chaining
addUI5FilterConditions(aUI5Filter): sap.ui.model.analytics.odata4analytics.FilterExpression
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.

Parameters:
{array(sap.ui.model.Filter)}aUI5Filter Array of UI5 filter objects
Returns:
{sap.ui.model.analytics.odata4analytics.FilterExpression} This object for method chaining
checkValidity(): boolean
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

Returns:
{boolean} The value true. In case the expression violates some of the rules, an exception with some explanatory message is thrown
clear()
Clear expression from any conditions that may have been set previously
Get description for this entity type
Returns:
{sap.ui.model.analytics.odata4analytics.EntityType} The object representing the entity type
getExpressionAsUI5FilterArray(): array(sap.ui.model.Filter)
Get an array of SAPUI5 Filter objects corresponding to this expression.
Returns:
{array(sap.ui.model.Filter)} List of filter objects representing this expression
getURIFilterOptionValue(): string
Get the value for the OData system query option $filter corresponding to this expression.
Returns:
{string} The $filter value for the filter expression
Remove all conditions for some property from the filter expression.

All previously set conditions for some property are removed from the filter expression.

Parameters:
{string}sPropertyName The name of the property bound in the condition
Exceptions:
Exception if the property is unknown
Returns:
{sap.ui.model.analytics.odata4analytics.FilterExpression} This object for method chaining