Skip to content

Commit 9858fed

Browse files
committed
Moved all @Assert, @readonly, @mandatory to guides/services/constraints
1 parent b492342 commit 9858fed

File tree

8 files changed

+359
-344
lines changed

8 files changed

+359
-344
lines changed

cds/annotations.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ uacp: Used as link target from Help Portal at https://help.sap.com/products/BTP/
3636

3737
| Annotation | Description |
3838
|---------------------|----------------------------------------------------------------------|
39-
| `@readonly ` | see [Input Validation](../guides/providing-services#readonly) |
40-
| `@mandatory` | see [Input Validation](../guides/providing-services#mandatory) |
41-
| `@assert.target` | see [Input Validation](../guides/providing-services#assert-target) |
42-
| `@assert.format` | see [Input Validation](../guides/providing-services#assert-format) |
43-
| `@assert.range` | see [Input Validation](../guides/providing-services#assert-range) |
39+
| `@readonly ` | see [Input Validation](../guides/services/constraints#readonly) |
40+
| `@mandatory` | see [Input Validation](../guides/services/constraints#mandatory) |
41+
| `@assert.target` | see [Input Validation](../guides/services/constraints#assert-target) |
42+
| `@assert.format` | see [Input Validation](../guides/services/constraints#assert-format) |
43+
| `@assert.range` | see [Input Validation](../guides/services/constraints#assert-range) |
4444

4545

4646

@@ -91,8 +91,8 @@ Intrinsically supported OData Annotations:
9191

9292
| Annotation | Description |
9393
|------------------------|------------------------------------------------------------------|
94-
| `@Core.Computed` | see [Providing Services](../guides/providing-services#readonly) |
95-
| `@Core.Immutable` | see [Providing Services](../guides/providing-services#readonly) |
94+
| `@Core.Computed` | see [Providing Services](../guides/services/constraints#readonly) |
95+
| `@Core.Immutable` | see [Providing Services](../guides/services/constraints#readonly) |
9696
| `@Core.MediaType` | see [Media Data](../guides/providing-services#serving-media-data) |
9797
| `@Core.IsMediaType` | see [Media Data](../guides/providing-services#serving-media-data) |
9898
| `@Core.IsUrl` | see [Media Data](../guides/providing-services#serving-media-data) |

cds/cdl.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ entity Bar {
482482

483483
An element definition can be prefixed with modifier keyword `virtual`. This keyword indicates that this element isn't added to persistent artifacts, that is, tables or views in SQL databases. Virtual elements are part of OData metadata.
484484

485-
By default, virtual elements are annotated with `@Core.Computed: true`, not writable for the client and will be [silently ignored](../guides/providing-services#readonly). This means also, that they are not accessible in custom event handlers. If you want to make virtual elements writable for the client, you explicitly need to annotate these elements with `@Core.Computed: false`. Still those elements are not persisted and therefore, for example, not sortable or filterable. Further, during read requests, you need to provide values for all virtual elements. You can do this by using post-processing in an `after` handler.
485+
By default, virtual elements are annotated with `@Core.Computed: true`, not writable for the client and will be [silently ignored](../guides/services/constraints#readonly). This means also, that they are not accessible in custom event handlers. If you want to make virtual elements writable for the client, you explicitly need to annotate these elements with `@Core.Computed: false`. Still those elements are not persisted and therefore, for example, not sortable or filterable. Further, during read requests, you need to provide values for all virtual elements. You can do this by using post-processing in an `after` handler.
486486

487487
```cds
488488
entity Employees {
@@ -695,7 +695,7 @@ entity Order {
695695
}
696696
```
697697

698-
To enforce your _enum_ values during runtime, use the [`@assert.range` annotation](../guides/providing-services#assert-range).
698+
To enforce your _enum_ values during runtime, use the [`@assert.range` annotation](../guides/services/constraints#assert-range).
699699
For localization of enum values, model them as [code list](./common#adding-own-code-lists).
700700

701701
<br>

guides/databases.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,7 @@ CREATE TABLE Books_texts (
916916
::: warning Database constraints aren't intended for checking user input
917917
Instead, they protect the integrity of your data in the database layer against programming errors. If a constraint violation occurs, the error messages coming from the database aren't standardized by the runtimes but presented as-is.
918918
919-
→ Use [`@assert.target`](providing-services#assert-target) for corresponding input validations.
919+
→ Use [`@assert.target`](services/constraints#assert-target) for corresponding input validations.
920920
:::
921921
922922
## Standard Database Functions

0 commit comments

Comments
 (0)