Skip to content

Commit 586422e

Browse files
authored
Merge branch 'main' into cxl
2 parents 811576f + 243847b commit 586422e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+14625
-1153
lines changed

cds/types.md

Lines changed: 34 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -10,55 +10,40 @@ status: released
1010
# Core / Built-in Types
1111

1212

13-
The following table lists the built-in types available to all CDS models, and can be used to define entity elements or custom types as follows:
14-
15-
```cds
16-
entity Books {
17-
key ID : UUID;
18-
title : String(111);
19-
stock : Integer;
20-
price : Price;
21-
}
22-
type Price : Decimal;
23-
```
24-
25-
These types are used to define the structure of entities and services, and are mapped to respective database types when the model is deployed.
26-
27-
| CDS Type | Remarks | ANSI SQL <sup>(1)</sup> |
28-
| --- | --- | --- |
29-
| `UUID` | CAP generates [RFC 4122](https://tools.ietf.org/html/rfc4122)-compliant UUIDs <sup>(2)</sup> | _NVARCHAR(36)_ |
30-
| `Boolean` | Values: `true`, `false`, `null`, `0`, `1` | _BOOLEAN_ |
31-
| `Integer` | Same as `Int32` by default | _INTEGER_ |
32-
| `Int16` | Signed 16-bit integer, range *[ -2<sup>15</sup> ... +2<sup>15</sup> )* | _SMALLINT_ |
33-
| `Int32` | Signed 32-bit integer, range *[ -2<sup>31</sup> ... +2<sup>31</sup> )* | _INTEGER_ |
34-
| `Int64` | Signed 64-bit integer, range *[ -2<sup>63</sup> ... +2<sup>63</sup> )* | _BIGINT_ |
35-
| `UInt8` | Unsigned 8-bit integer, range *[ 0 ... 255 ]* | _TINYINT_ <sup>(3)</sup> |
36-
| `Decimal` (`prec`, `scale`) | A *decfloat* type is used if arguments are omitted | _DECIMAL_ |
37-
| `Double` | Floating point with binary mantissa | _DOUBLE_ |
38-
| `Date` | e.g. `2022-12-31` | _DATE_ |
39-
| `Time` | e.g. `23:59:59` | _TIME_ |
40-
| `DateTime` | _sec_ precision | _TIMESTAMP_ |
41-
| `Timestamp` | _µs_ precision, with up to 7 fractional digits | _TIMESTAMP_ |
42-
| `String` (`length`) | Default *length*: 255; on HANA: 5000 <sup>(4)(5)</sup> | _NVARCHAR_ |
43-
| `Binary` (`length`) | Default *length*: 255; on HANA: 5000 <sup>(4)(6)</sup> | _VARBINARY_ |
44-
| `LargeBinary` | Unlimited data, usually streamed at runtime<br/>[Prefer using Attachments plugin for large files](../plugins/index.md#attachments) | _BLOB_ |
45-
| `LargeString` | Unlimited data, usually streamed at runtime | _NCLOB_ |
46-
| `Map` | Mapped to *NCLOB* for HANA. | *JSON* type |
47-
| `Vector` (`dimension `) | Requires SAP HANA Cloud QRC 1/2024, or later | _REAL_VECTOR_ |
48-
49-
> <sup>(1)</sup> Concrete mappings to specific databases may differ.
50-
>
51-
> <sup>(2)</sup> See also [Best Practices](../guides/domain/index#don-t-interpret-uuids).
52-
>
53-
> <sup>(3)</sup> _SMALLINT_ on PostgreSQL and H2.
54-
>
55-
> <sup>(4)</sup> Productive apps should always use an explicit length. Use the default only for rapid prototyping.
56-
>
57-
> <sup>(5)</sup> Configurable through `cds.cdsc.defaultStringLength`.
58-
>
59-
> <sup>(6)</sup> Configurable through `cds.cdsc.defaultBinaryLength`.
60-
61-
#### See also...
13+
The following table lists the built-in types in CDS, and their most common mapping to
14+
ANSI SQL types, when deployed to a relational database (concrete mappings to specific databases may differ):
15+
16+
| CDS Type | Remarks | ANSI SQL |
17+
|---------------------|------------------------------------------------------------------------|----------------|
18+
| `UUID` | [RFC 4122](https://tools.ietf.org/html/rfc4122)-compliant UUIDs | _NVARCHAR(36)_ |
19+
| `Boolean` | Values: `true`, `false`, `null`, `0`, `1` | _BOOLEAN_ |
20+
| `Integer` | Same as `Int32` by default | _INTEGER_ |
21+
| `Int16` | Signed 16-bit integer, range *[ -2<sup>15</sup> ... +2<sup>15</sup> )* | _SMALLINT_ |
22+
| `Int32` | Signed 32-bit integer, range *[ -2<sup>31</sup> ... +2<sup>31</sup> )* | _INTEGER_ |
23+
| `Int64` | Signed 64-bit integer, range *[ -2<sup>63</sup> ... +2<sup>63</sup> )* | _BIGINT_ |
24+
| `UInt8` | Unsigned 8-bit integer, range *[ 0 ... 255 ]* | _TINYINT_ |
25+
| `Decimal`(`p`,`s`) | Decimal with precision `p` and scale `s` | _DECIMAL_ |
26+
| `Double` | Floating point with binary mantissa | _DOUBLE_ |
27+
| `Date` | e.g. `2022-12-31` | _DATE_ |
28+
| `Time` | e.g. `23:59:59` | _TIME_ |
29+
| `DateTime` | _sec_ precision | _TIMESTAMP_ |
30+
| `Timestamp` | _µs_ precision, with up to 7 fractional digits | _TIMESTAMP_ |
31+
| `String` (`length`) | Default *length*: 255; on HANA: 5000 | _NVARCHAR_ |
32+
| `Binary` (`length`) | Default *length*: 255; on HANA: 5000 | _VARBINARY_ |
33+
| `Vector` (`length`) | SAP HANA Cloud QRC 1/2024, or later only | _REAL_VECTOR_ |
34+
| `LargeBinary` | Unlimited binary data, usually streamed at runtime | _BLOB_ |
35+
| `LargeString` | Unlimited textual data, usually streamed at runtime | _NCLOB_ |
36+
| `Map` | Mapped to *NCLOB* for HANA. | *JSON* type |
37+
38+
> [!info] Default String Lengths
39+
> Lengths can be omitted, in which case default lengths are used. While this is usual in initial phases of a project, productive apps should always use explicitly defined length. The respective default lengths are configurable through the config options
40+
> <Config> cds.cdsc.defaultStringLength = 255 </Config> and <br/>
41+
> <Config> cds.cdsc.defaultBinaryLength = 255 </Config>.
42+
43+
> [!tip] Use Attachments instead of LargeBinary
44+
> Consider using _Attachments_, as provided through [the CAP Attachments plugins](../plugins/index#attachments), instead of `LargeBinary` types for user-generated content like documents, images, etc.
45+
46+
See also:
6247

6348
[Additional Reuse Types and Aspects by `@sap/cds/common`](common) {.learn-more}
6449

get-started/feature-matrix.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,7 @@ Following is an index of the features currently covered by CAP, with status and
114114
| [Arrayed Elements](../cds/cdl#arrayed-types) | <X/> | <X/> | <X/> |
115115
| [Streaming & Media Types](../guides/services/media-data) | <X/> | <X/> | <X/> |
116116
| [Conflict Detection through _ETags_](../guides/services/served-ootb#etag) | <X/> | <X/> | <X/> |
117-
| [Authentication via JWT](../guides/security/authorization#prerequisite-authentication) | <Na/> | <X/> | <X/> |
118-
| [Mocked Authentication](../guides/security/authorization#prerequisite-authentication) | <Na/> | <X/> | <X/> |
117+
| [Authentication](../guides/security/authentication) | <X/> | <X/> | <X/> |
119118

120119

121120
<br>

get-started/get-help.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ A new option `privilegedUser()` can be leveraged when [defining](../java/event-h
292292

293293
| | Explanation |
294294
|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
295-
| _Root Cause_ | You've [explicitly configured a mock](../java/security#explicitly-defined-mock-users) user with a name that is already used by a [preconfigured mock user](../java/security#preconfigured-mock-users). |
295+
| _Root Cause_ | You've [explicitly configured a mock](../java/security#custom-mock-users) user with a name that is already used by a [preconfigured mock user](../java/security#preconfigured-mock-users). |
296296
| _Solution_ | Rename the mock user and build your project again. |
297297

298298
### Why do I get an "Error on server start"?
@@ -678,7 +678,7 @@ By default, the Cloud MTA Build Tool executes module builds in parallel. If you
678678

679679
`cf undeploy <mta-id>` deletes an MTA (use `cf mtas` to find the MTA ID).
680680

681-
Use the optional `--delete-services` parameter to also wipe service instances.
681+
Use `--delete-services`, `--delete-service-keys` and `--delete-service-brokers` parameters to also wipe services, service keys, or service brokers.
682682

683683
::: danger This also deletes the HDI containers with the application data.
684684
:::

get-started/index.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ Then install CAP's _cds-dk_ globally:
4949
### Node.js and _cds-dk_ {.required}
5050

5151
```shell
52-
brew install node@24 # Node.js latest LTS
53-
npm add --global @sap/cds-dk # CAP's cds-dk
52+
brew install node # Node.js latest LTS
53+
npm i -g @sap/cds-dk # CAP's cds-dk
5454
```
5555

5656

@@ -60,10 +60,6 @@ npm add --global @sap/cds-dk # CAP's cds-dk
6060
brew install sapmachine-jdk
6161
brew install maven
6262
```
63-
```shell
64-
code --install-extension oracle.oracle-java # for Java
65-
code --install-extension vscjava.vscode-maven # for Maven
66-
```
6763

6864

6965
### Git and GitHub {.optional}
@@ -80,12 +76,18 @@ brew install github # GitHub Desktop App
8076

8177
```shell
8278
brew install --cask visual-studio-code # VS Code itself
79+
```
80+
```shell
8381
code --install-extension sapse.vscode-cds # for .cds models
8482
code --install-extension mechatroner.rainbow-csv # for .csv files
8583
code --install-extension qwtel.sqlite-viewer # for .sqlite files
8684
code --install-extension humao.rest-client # for REST requests
8785
code --install-extension dbaeumer.vscode-eslint # for linting
8886
```
87+
```shell
88+
code --install-extension oracle.oracle-java # for Java
89+
code --install-extension vscjava.vscode-maven # for Maven
90+
```
8991

9092

9193
> You can of course also use other IDEs or editors of your choice, such as [IntelliJ IDEA](https://www.jetbrains.com/idea/), for which we also provide [support](../tools/cds-editors#intellij). Yet we strongly recommend Visual Studio Code for the best experience with CAP.

guides/databases/cdl-to-ddl.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,9 +345,9 @@ LEFT JOIN Genres as genre on genre_ID = genre.ID; -- [!code ++]
345345
```
346346
:::
347347

348-
> [!tip] Associations as <i>Forward-declared JOINs</i>
348+
> [!tip] Associations as <i>'Forward-declared' JOINs</i>
349349
> Looking closely at the above compiled SQL code, we can regard
350-
> associations to be like _'Forward-declared JOINs'_, along these lines:
350+
> associations to be like _'Forward-declared' JOINs_, along these lines:
351351
>
352352
> 1. Association names `a.name` appear in queries as standard _table aliases_
353353
> 2. _JOINs_ are added automatically as per the following construction rule:

guides/deploy/microservices.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ Note that we use the *--ws-pack* option for some modules. It's important for nod
370370

371371
### Authentication
372372

373-
Add [security configuration](../security/authorization#xsuaa-configuration) using the command:
373+
Add [security configuration](../security/authentication) using the command:
374374

375375
```shell
376376
cds add xsuaa --for production

guides/deploy/to-cf.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ cds add xsuaa
150150
```
151151

152152
::: tip This will also generate an `xs-security.json` file
153-
The roles/scopes are derived from authorization-related annotations in your CDS models. Ensure to rerun `cds compile --to xsuaa`, as documented in the [_Authorization_ guide](../security/authorization#xsuaa-configuration) whenever there are changes to these annotations.
153+
The roles/scopes are derived from authorization-related annotations in your CDS models. Ensure to rerun `cds compile --to xsuaa`, as documented in the [_Security_ guide](../security/cap-users#xsuaa-roles) whenever there are changes to these annotations.
154154
:::
155155

156156
[Learn more about SAP Authorization and Trust Management/XSUAA.](https://discovery-center.cloud.sap/serviceCatalog/authorization-and-trust-management-service?region=all){.learn-more}

guides/playbook.drawio.svg

Lines changed: 1 addition & 1 deletion
Loading

guides/security/_menu.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
# [SAP Product Standards](../../../guides/security/product-standards) <!-- INTERNAL -->
2-
# [CAP-level Authorization](authorization)
3-
# [Platform Security](platform)
4-
# [Data Protection](data-protection)
5-
# [Data Privacy](data-privacy)
1+
2+
# [Security Overview](overview)
3+
# [Authentication](authentication)
4+
# [CAP Users](cap-users)
5+
# [CAP Authorization](authorization)
6+
# [Remote Authentication](remote-authentication)
7+
# [Data Privacy Overview](data-privacy)
68
# [Annotating Personal Data](dpp-annotations)
79
# [Automatic Audit Logging](dpp-audit-logging)
810
# [Personal Data Management](dpp-pdm)
911
<!-- ## [Data Retention Management](dpp-drm) -->
12+
# [Product Security Overview](data-protection)
13+
# [Product Security Standard](../../../guides/security/product-standards) <!-- INTERNAL -->

guides/security/assets/add-api.png

19.1 KB
Loading

0 commit comments

Comments
 (0)