SAP / olingo-jpa-processor-v4

The JPA Processor fills the gap between Olingo V4 and the database, by providing a mapping between JPA metadata and OData metadata, generating queries and supporting the entity manipulations.
Apache License 2.0
122 stars 78 forks source link

Filter query for startwith/contains doesn't work with not. #266

Closed keshavsahuzellis closed 7 months ago

keshavsahuzellis commented 9 months ago

Below query are not working. ?$filter=not startswith(FieldName,'XX') ?$filter=startswith(FieldName,'XX') eq true ?$filter=not contains(FieldName,'XX')

wog48 commented 7 months ago

I tested the query functions with my test data model. Unfortunately, I got the expected results. In general, it can be expected that the sum of the number of results for not startswith and startswith is the same as the overall number of results. So e.g.: AdministrativeDivisions/$count?$filter=not startswith(DivisionCode,'BE') plus AdministrativeDivisions/$count?$filter=startswith(DivisionCode,'BE' should be the same as AdministrativeDivisions/$count. This holds true as long as the property does not contain NULL values. To my understanding, based on 5.1.1.1.9 Not, OData requires the same behavior for NULL values as SQL, they are ignored.

To have a deep er look at your problem, I would need to have some more details:

keshavsahuzellis commented 7 months ago

@wog48 , we can close this as it is working on latest build, Thanks for your response

wog48 commented 7 months ago

Great news