Implement $filter in Olingo

3.6k Views Asked by At

Is there a good documentation on implementing $filter in Olingo? the one on Olingo web site is not helping me because I am not accessing backend data using JDBC. Any sample code would also help.

Thanks,

2

There are 2 best solutions below

0
On

Are you referring to this? http://olingo.apache.org/doc/odata2/tutorials/Olingo_Tutorial_AdvancedRead_FilterVisitor.html

The concept is the same. The example is taking a filter expression and converting it into SQL. You can take the same pattern and create whatever underlaying query you need from the $filter value.

0
On

You can use uriInfo.getFilter() to obtain the filter expression from the request.

This expression returns a FilterExpression, that can be further break down into various <? extends CommonExpression>, such as BinaryExpression or MethodExpression.

Please have a look at https://olingo.apache.org/javadoc/odata2/org/apache/olingo/odata2/api/uri/expression/CommonExpression.html