You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@olingo.apache.org by "Naser, Moneer" <mo...@sap.com> on 2016/01/17 13:52:26 UTC

$filter before fetching data

Hi,
In real world scenarios, we want to build a statement based on OData request filters, and execute it against our backend, and not apply the filters to all pre-fetched entities.
How can I use Olingo v4 filtering capabilities to achieve this goal? It seems that the visitor pattern is not intended for this.

Any help or examples is greatly appreciated.

Thanks,
Moneer


RE: $filter before fetching data

Posted by "Amend, Christian" <ch...@sap.com>.
Hi Moneer,

You don`t have to pre-fetch all entities and then use the visitor to exclude some of them. This is only the way we used in our technical scenario because the whole data source is in-memory anyway. This scenario is only used for testing purposes.

The way I would do it in a real live scenario is either to implement the visitor in a way that it creates the WHERE clause for you. Or use the parsed filter from our URIInfo object an interpret the filter on your own to create the WHERE clause.

Best Regards,
Christian

From: Naser, Moneer [mailto:moneer.naser@sap.com]
Sent: Sonntag, 17. Januar 2016 13:52
To: user@olingo.apache.org
Subject: $filter before fetching data

Hi,
In real world scenarios, we want to build a statement based on OData request filters, and execute it against our backend, and not apply the filters to all pre-fetched entities.
How can I use Olingo v4 filtering capabilities to achieve this goal? It seems that the visitor pattern is not intended for this.

Any help or examples is greatly appreciated.

Thanks,
Moneer