Skip to Content
Jul 01, 2020 at 01:23 AM

CAP - Auto-incremental IDs / numbering, use of hdbsequence/hdbtrigger/hdbsynonym



It seems CAP model does not yet offer a streamlined numbering capability like ABAP (number objects) or HDI (hdbsequence & hdbtrigger).

It seems it is possible to use HDI. However, the limited examples I found seem to include schemas/namespaces whereas schema management is hidden in CAP and I am not sure how to refer the tables that CAP manages. So, I am not sure how HDI and CAP can be implemented together. For example, given the following entity definition:


entity BPartners : managed, cuid {
  seqID : Integer;
  name: String;

1. What should the .hdbsequence file content look like if it needs to (e.g. for reset_by) refer to the table that is linked to the above entity definition?

2. How do we retrieve nextval/currentval from the hdbsequence in Node.js?

3. Because the number is ideally to be increased at the time of DB save, may the event handlers at service level be too early to increase the counter and assign the ID, e.g. on .before ('CREATE'...)? If yes and if .hdbtrigger & .hdbsynonym need to be used, how should their contents look like?

Kind Regards