Skip to content

Commit c87f0d0

Browse files
Minor fixes in CDL Language Preliminaries (#2195)
Working through this section to learn more, I came across a few places that might benefit from very minor improvements. Thanks! - 24:59:59 is just wishful thinking :) - remove duplicated paragraph - add tip about made-up annotations in example - clarify ref to prev model - make comma spacing consistent --------- Co-authored-by: René Jeglinsky <rene.jeglinsky@sap.com>
1 parent bfed019 commit c87f0d0

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

cds/cdl.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ The *Conceptual Definition Language (CDL)* is a human-readable language for defi
4141

4242
```cds
4343
namespace capire.bookshop;
44-
using { managed, cuid } from `@sap/cds/common`;
44+
using { managed, cuid } from '@sap/cds/common';
4545
aspect primary : managed, cuid {}
4646
4747
entity Books : primary {
@@ -85,7 +85,7 @@ The following literals can be used in CDL (mostly as in JavaScript, Java, and SQ
8585
<!-- cds-mode: ignore; values only, no valid CDS file -->
8686
```cds
8787
true , false , null // as in all common languages
88-
11 , 2.4 , 1e3, 1.23e-11 // for numbers
88+
11 , 2.4 , 1e3 , 1.23e-11 // for numbers
8989
'A string''s literal' // for strings
9090
`A string\n paragraph` // for strings with escape sequences
9191
{ foo:'boo', bar:'car' } // for records
@@ -130,6 +130,10 @@ entity DocumentedEntity {
130130
}
131131
```
132132

133+
::: tip
134+
These annotations are illustrative only and are not defined nor have any meaning beyond this example.
135+
:::
136+
133137
Within those strings, escape sequences from JavaScript, such as `\t` or `\u0020`, are supported. Line endings are normalized. If you don't want a line ending at that position, end a line with a backslash (`\`). For string literals inside triple backticks, indentation is stripped and tagging is possible.
134138

135139

@@ -238,7 +242,7 @@ context scoped {
238242

239243
You can define types and entities with other definitions' names as prefixes:
240244

241-
```cds
245+
```cds [prefixes.cds]
242246
namespace foo.bar;
243247
entity Foo {} //> foo.bar.Foo
244248
entity Foo.Bar {} //> foo.bar.Foo.Bar
@@ -248,7 +252,7 @@ type Foo.Bar.Car {} //> foo.bar.Foo.Bar.Car
248252

249253
#### Fully Qualified Names
250254

251-
A model ultimately is a collection of definitions with unique, fully qualified names. For example, the second model above would compile to this [CSN](./csn):
255+
A model ultimately is a collection of definitions with unique, fully qualified names. For example, the model in `contexts.cds` would compile to the following [CSN](./csn):
252256

253257
::: code-group
254258

cds/types.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ These types are used to define the structure of entities and services, and are m
3636
| `Decimal` (`prec`, `scale`) | A *decfloat* type is used if arguments are omitted | _DECIMAL_ |
3737
| `Double` | Floating point with binary mantissa | _DOUBLE_ |
3838
| `Date` | e.g. `2022-12-31` | _DATE_ |
39-
| `Time` | e.g. `24:59:59` | _TIME_ |
39+
| `Time` | e.g. `23:59:59` | _TIME_ |
4040
| `DateTime` | _sec_ precision | _TIMESTAMP_ |
4141
| `Timestamp` | _µs_ precision, with up to 7 fractional digits | _TIMESTAMP_ |
4242
| `String` (`length`) | Default *length*: 255; on HANA: 5000 <sup>(4)(5)</sup> | _NVARCHAR_ |
@@ -46,8 +46,6 @@ These types are used to define the structure of entities and services, and are m
4646
| `Map` | Mapped to *NCLOB* for HANA. | *JSON* type |
4747
| `Vector` (`dimension `) | Requires SAP HANA Cloud QRC 1/2024, or later | _REAL_VECTOR_ |
4848

49-
These types are used to define the structure of entities and services, and are mapped to respective database types when the model is deployed.
50-
5149
> <sup>(1)</sup> Concrete mappings to specific databases may differ.
5250
>
5351
> <sup>(2)</sup> See also [Best Practices](../guides/domain-modeling#don-t-interpret-uuids).

0 commit comments

Comments
 (0)