on 05-24-2021 8:41 AM
Wanted to report a bug. Not sure if this is the right place, but couldn't find another place to report this.
I'm using the CQN parser in CAP Java.
I have a CQN generated by a Fiori Elements application, so I assume it was generated correctly.
This is the query:
{"SELECT":{"from":{"ref":["MainService.SalesOrders"]},"count":true,"columns":[{"ref":["ID"]},{"ref":["VBELN"]},{"ref":["AUART"]},{"ref":["VKORG"]},{"ref":["VTWEG"]},{"ref":["SPART"]},{"ref":["SOLDTO"]},{"ref":["SHIPTO"]},{"ref":["IsActiveEntity"]},{"ref":["HasActiveEntity"]}],"where":[{"ref":["IsActiveEntity"]},"is",{"val":false},"or",{"ref":["SiblingEntity","IsActiveEntity"]},"is","null"],"orderBy":[{"ref":["ID"]},{"ref":["IsActiveEntity"]}],"limit":{"rows":{"val":30}}}}
I converted this query to a string and then tried parsing it back to CQN as follows:
CqnSelect myCqn = context.getCqn();
String cqnString = myCqn.toString();
CqnSelect = Select.cqn(cqnString);
This code results in the following error:
ChangeSet 7 as cancelled: Unexpeceted token "false" at position 2. Expecting "null". (service 'MainService', event 'READ', entity 'MainService.SalesOrders')
However, this "false" at position 2 {"ref":["IsActiveEntity"]},"is",{"val":false}, is exactly as the application originally generated it. I didn't change this at all.
We'll provide a fix for this issue with the next release.
For the time being please to avoid to serialize the statement to CQN and parse it again. Instead please consider to use the APIs for statement modification: https://cap.cloud.sap/docs/java/query-api#copy--modify-cds-ql-statements
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank's for bringing this to our attention. We'll have a look.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi!
Could you please share which version of CAP Java you are using?
Thanks,
Robin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
77 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.