Skip to Content
1
Jan 20, 2020 at 01:14 PM

Generated GUID from @sap/cds/common/CUID does not work on HANA

474 Views

Hello,

we are using the @sap/cds/common/CUID as an identifier in our entities defined in CDS.

entity CST_FRISTIGKEITEN: cuid, managed, temporal { 
 CLEAN_PARAM : String(50)  not null;
...
}

We have CSV files, that fill these master data tables with initial entries. We did NOT include the ID field, as this should be filled automatically by the CUID aspect.

When we test the project locally, the CDS deploy to sqlite will insert the data correct. GUIDs are automatically generated and inserted (initial and also later when using the service for inserts).

Now when we deploy this project to hana, you will get a deployment error. Reason: HANA generates a "regular" ID field. No autofill happens there. It reads the csv files, tries to insert them and bam, column "id" missisng in csv file.

Is this a bug or how is this ever supposed to work? Please consider that basically everyone wants to deploy it to hana in the end, and there it is not working. It is clear, that for the command line tools with sqlite, it is the CDS tools which actually generates the id and successfully inserts the data...hana deployer does not yet do that, but should be doing the same.

Please shed some light on this.

Thanks and regads,

Tobias