Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .vitepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ config.rewrites = rewrites
// Add custom capire info to the theme config
config.themeConfig.capire = {
versions: {
java_services: '3.10.1',
java_cds4j: '3.10.1'
java_services: '4.0.2',
java_cds4j: '4.0.2'
},
gotoLinks: [],
maven_host_base: 'https://repo1.maven.org/maven2'
Expand Down
65 changes: 0 additions & 65 deletions advanced/odata.md
Original file line number Diff line number Diff line change
Expand Up @@ -1138,71 +1138,6 @@ GET SalesOrganizations?$apply=
/ancestors(..., ID, filter(contains(Name, 'New York')), keep start)
```

#### Modeling Recursive Hierarchies

Recursive hierarchies are parent-child hierarchies, where each entity references its parent and through that defines the hierarchical structure. A common example is a company organization structure or HR reporting, where each employee entity references another employee a as direct report or manager.

##### Domain Model

The simplest domain model looks as follows:

```cds
entity Employee : Hierarchy {
key ID : UUID;
parent : Association to Employee;
fullName : String;
}

aspect Hierarchy {
virtual LimitedDescendantCount : Integer64;
virtual DistanceFromRoot : Integer64;
virtual DrillState : String;
virtual LimitedRank : Integer64;
}
```

The entity `Employee` has the element `ID`, which identifies the hierarchy node. The `parent` association references the same entity, which establishes the parent-child relationship.

##### Virtual Elements of a Hierarchy

The `Hierarchy` aspect defines a set of virtual elements, automatically calculated by the backend at runtime, to describe the state of the hierarchy. This information is requested by the UI to correctly render the hierarchy in a *TreeTable* during user interaction.

##### Service Model

The following service defines the projection on the domain model.

```cds
service HRService {
entity HREmployee as projection on Employee;
}
```


##### OData v4 Annotations for Fiori

To link the backend and Fiori UI, the projected service entity must be enriched with the following annotations.

```cds
annotate HRService.HREmployee with @Aggregation.RecursiveHierarchy #EmployeeHierarchy: {
$Type: 'Aggregation.RecursiveHierarchyType',
NodeProperty: ID,
ParentNavigationProperty: parent
};
```

Here the `EmployeeHierarchy` specifies a hierarchy qualifier, `NodeProperty` (identifying the hierarchy node) is linked to `ID` of the entity `HREmployee`, and the `ParentNavigationProperty` is linked to a corresponding `parent` association.

```cds
annotate HRService.HREmployee with @Hierarchy.RecursiveHierarchy #EmployeeHierarchy: {
$Type: 'Hierarchy.RecursiveHierarchyType',
LimitedDescendantCount: LimitedDescendantCount,
DistanceFromRoot: DistanceFromRoot,
DrillState: DrillState,
LimitedRank: LimitedRank
};
```

Here the same qualifier `EmployeeHierarchy` is referenced to list the names of the [virtual elements of the hierarchy](#virtual-elements-of-a-hierarchy).

### Aggregation Methods

Expand Down
14 changes: 1 addition & 13 deletions guides/deployment/microservices.md
Original file line number Diff line number Diff line change
Expand Up @@ -466,18 +466,6 @@ resources:
```
:::

Add the *processed-after* property, so that the xsuaa instance is created after the messaging:

::: code-group
```yaml [mta.yaml]
resources:
...
- name: samples-auth
processed-after: #[!code ++]
- samples-messaging #[!code ++]
```
:::

::: details Configure each app for cloud readiness
Enable messaging for the modules that use it:

Expand Down Expand Up @@ -593,7 +581,7 @@ mv app/router .deploy/app-router
```

::: code-group
```yaml
```yaml [mta.yaml]
modules:
...
- name: samples
Expand Down
2 changes: 2 additions & 0 deletions node.js/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -588,3 +588,5 @@ Content-Type: application/json

> [!warning] Error Sanitization
> In production, error responses should never disclose internal information that could be exploited by attackers. To ensure that, all errors with a `5xx` status code are returned to the client with only the respective generic message (example: `500 Internal Server Error`).
>
> In very rare cases, you might want to return 5xx errors with a meaningful message to the client. This can be achieved with `err.$sanitize = false`. Use that option with care!
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.