You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Werner Mueller (JIRA)" <ji...@apache.org> on 2017/05/04 15:08:04 UTC

[jira] [Updated] (OLINGO-1120) Is grouping in $filter with "(" and ")" possible?

     [ https://issues.apache.org/jira/browse/OLINGO-1120?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Werner Mueller updated OLINGO-1120:
-----------------------------------
    Description: 
I'm implementing an OData-server-application with Version v4.3.0 of Olingo.

According to  
https://olingo.apache.org/doc/odata4/tutorials/sqo_f/tutorial_sqo_f.html 
I created an ExpressionVisitor 
to construct a valid JDBC/SQL-where constraint.

I had a look to 
https://olingo.apache.org/doc/odata2/tutorials/Olingo_Tutorial_AdvancedRead_FilterVisitor.html
also.

My problem is with grouping. 

OData states that the Operators "(" and ")" should have the highest precedence (5.1.1.9 Operator Precedence, 
http://docs.oasis-open.org/odata/odata/v4.0/os/part2-url-conventions/odata-v4.0-os-part2-url-conventions.html)

How can I handle grouping with the ExpressionVisitor?

These are my urls for testing:
http://localhost:8080/Odata.svc/SomeEnittySet?$filter=(id gt 5 or shortName ne 'xxx' or name eq 'test') or (name eq 'xxx' and id lt 567)

and 

http://localhost:8080/Odata.svc/SomeEnittySet?$filter=(id gt 5 or  shortName ne 'xxx' or name eq 'test') or name eq 'xxx' and id lt 567


  was:
I'm implementing an OData-server-application with Version v4.3.0 of 
Olingo.

According to  
https://olingo.apache.org/doc/odata4/tutorials/sqo_f/tutorial_sqo_f.html I 
created an ExpressionVisitor 
to construct a valid JDBC/SQL-where constraint.

I had a look to 
https://olingo.apache.org/doc/odata2/tutorials/Olingo_Tutorial_AdvancedRead_FilterVisitor.html
also.

My problem is with grouping. 

OData states that the Operators "(" and ")" should have the highest precedence (5.1.1.9 Operator Precedence, 
http://docs.oasis-open.org/odata/odata/v4.0/os/part2-url-conventions/odata-v4.0-os-part2-url-conventions.html)

How can I handle grouping with the ExpressionVisitor?

These are my urls for testing:
http://localhost:8080/Odata.svc/SomeEnittySet?$filter=(id gt 5 or shortName ne 'xxx' or name eq 'test') or (name eq 'xxx' and id lt 567)

and 

http://localhost:8080/Odata.svc/SomeEnittySet?$filter=(id gt 5 or  shortName ne 'xxx' or name eq 'test') or name eq 'xxx' and id lt 567



> Is grouping in $filter with  "(" and ")" possible?
> --------------------------------------------------
>
>                 Key: OLINGO-1120
>                 URL: https://issues.apache.org/jira/browse/OLINGO-1120
>             Project: Olingo
>          Issue Type: Question
>          Components: odata4-server
>    Affects Versions: (Java) V4 4.3.0
>            Reporter: Werner Mueller
>
> I'm implementing an OData-server-application with Version v4.3.0 of Olingo.
> According to  
> https://olingo.apache.org/doc/odata4/tutorials/sqo_f/tutorial_sqo_f.html 
> I created an ExpressionVisitor 
> to construct a valid JDBC/SQL-where constraint.
> I had a look to 
> https://olingo.apache.org/doc/odata2/tutorials/Olingo_Tutorial_AdvancedRead_FilterVisitor.html
> also.
> My problem is with grouping. 
> OData states that the Operators "(" and ")" should have the highest precedence (5.1.1.9 Operator Precedence, 
> http://docs.oasis-open.org/odata/odata/v4.0/os/part2-url-conventions/odata-v4.0-os-part2-url-conventions.html)
> How can I handle grouping with the ExpressionVisitor?
> These are my urls for testing:
> http://localhost:8080/Odata.svc/SomeEnittySet?$filter=(id gt 5 or shortName ne 'xxx' or name eq 'test') or (name eq 'xxx' and id lt 567)
> and 
> http://localhost:8080/Odata.svc/SomeEnittySet?$filter=(id gt 5 or  shortName ne 'xxx' or name eq 'test') or name eq 'xxx' and id lt 567



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)