Skip to content

Commit

Permalink
Clarify namespace, clarify relation service - entity (#730)
Browse files Browse the repository at this point in the history
* Clarify namespace, clarify relation service - entity

* a namespace is not an object
* relation entity/service is established via name

* split codeblock

* edit

* Update cds/cdl.md

Co-authored-by: René Jeglinsky <[email protected]>

* Update cds/cdl.md

Co-authored-by: René Jeglinsky <[email protected]>

* Update cds/cdl.md

---------

Co-authored-by: Rene Jeglinsky <[email protected]>
  • Loading branch information
stewsk and renejeglinsky authored Mar 11, 2024
1 parent 4f04bfb commit 57552fe
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions cds/cdl.md
Original file line number Diff line number Diff line change
Expand Up @@ -1539,6 +1539,29 @@ GET: /OrderWithParameter(foo=5)/Set or GET: /OrderWithParameter(5)/Set
GET: /ViewInService(p1=5, p2=true)/Set
```

To expose an entity, it's not necessary to be lexically enclosed in the service definition. An entity's affiliation to a service is established using its fully qualified name, so you can also use one of the following options:

- Add a namespace.
- Use the service name as prefix.

In the following example, all entities belong to/are exposed by the same service:

::: code-group
```cds [myservice.cds]
service foo.MyService {
entity A { /*...*/ };
}
entity foo.MyService.B { /*...*/ };
```
:::

::: code-group
```cds [another.cds]
namespace foo.MyService;
entity C { /*...*/ };
```
:::


### (Auto-) Redirected Associations {#auto-redirect}

Expand Down Expand Up @@ -1770,6 +1793,7 @@ entity Bar : Foo {} //> foo.bar.Bar
```
:::

A namespace is not an object of its own. There is no corresponding definition in CSN.

### The `context` Directive {#context}

Expand Down

0 comments on commit 57552fe

Please sign in to comment.