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
121
stars
76
forks
source link
[Question] Support for nested lambda operation #319
We are currently using v2.0.2 of olingo-jpa-processor-v4 library and have been trying to test the nested lambda operator usecase. Can you please kindly let me know if the library supports the nested lambda operation ?
Sample Query: http://localhost:8080/odata/Orders?$filter=OrderDetails/any(d:d/Product/any(p:p/ProductName eq 'Chai'))
In this example, we're filtering the 'Orders' entity set to only those orders that contain at least one 'OrderDetail' which is associated with a 'Product' having the 'ProductName' 'Chai'. The use of 'any' within another 'any' is an instance of a nested lambda operator.
Issue
We are facing a Null pointer Exception at JPALambdaOperation.getSubQuery() where uriResourceParts is being used to create an ArrayList of variable name allUriResourceParts.
Reason
JPAFilterElementComplier object being created at JPANavigationSubQuery.JPANavigationSubQuery() assigns null to the uriResourceParts while parsing the 2nd lambda operator.
JPAFilterElementComplier object that is being created as part of JPANavigationSubQuery.buildExpression() assigns null to the uriResourceParts.
Is there a reason why the above is being done ?
Stack Trace
What works ?: Single level lambda operation works as expected.
We are currently using v2.0.2 of olingo-jpa-processor-v4 library and have been trying to test the nested lambda operator usecase. Can you please kindly let me know if the library supports the nested lambda operation ?
Sample Query:
http://localhost:8080/odata/Orders?$filter=OrderDetails/any(d:d/Product/any(p:p/ProductName eq 'Chai'))
In this example, we're filtering the 'Orders' entity set to only those orders that contain at least one 'OrderDetail' which is associated with a 'Product' having the 'ProductName' 'Chai'. The use of 'any' within another 'any' is an instance of a nested lambda operator.Issue We are facing a Null pointer Exception at JPALambdaOperation.getSubQuery() where uriResourceParts is being used to create an ArrayList of variable name allUriResourceParts.
Reason JPAFilterElementComplier object being created at JPANavigationSubQuery.JPANavigationSubQuery() assigns null to the uriResourceParts while parsing the 2nd lambda operator.
JPAFilterElementComplier object that is being created as part of JPANavigationSubQuery.buildExpression() assigns null to the uriResourceParts.
Is there a reason why the above is being done ?
Stack Trace![image](https://github.com/SAP/olingo-jpa-processor-v4/assets/62653076/f2a2af0b-240d-4d75-9c48-10a1a78f85d5)
What works ?: Single level lambda operation works as expected.