Skip to Content
0
Nov 20 at 02:17 PM

How to create Local Key in CAPM like xsodata or remove the implicit ORDER BY on keys?

242 Views Last edit Nov 20 at 09:24 PM 2 rev

As I have a requirement to migrate the xsodata service from on-prem to CAPM based on cloud foundry. One of the .xsodata file contains an auto generated ephermal key which is based on:

https://help.sap.com/docs/SAP_HANA_PLATFORM/b3d0daf2a98e49ada00bf31b7ca7a42e/e86a01a7699a46528624d44678d37ea5.html

image.png

how this can also get created in CAPM's entities? I could not find any solution for its implementation.

My table in database does not contain this GenID so I added a before hook in my-srv.js and exposed the entity using req.target['elements'].

Then removed the GenID using delete req.target['elements']['GenID'] and so it got removed from the SELECT statement.

BUT - CAPM still adds ORDER BY GenID ... statement at the end of the SELECT query which still fails and there is no way to control the removal of default sorting on keys.

My idea was to remove the GenID from srv.before method, run the query and add some random UUID to it inside srv.after.

A gentleman has also encountered this issue:

https://answers.sap.com/questions/13228515/cap-nodejs-remove-implicit-sorting-on-primary-key.html

Is there any way out to solve this problem?

thanks

Attachments

image.png (111.4 kB)