on ‎2021 May 28 1:36 PM
Dear colleagues,
I'm trying to create a recursive data type using SAP CDS version 5.0.6. So far I experimented with the following:
type Node { value: String; children: many Node; }
This yields an error: 'Illegal circular reference'. Do you know how can this use case modelled in CDS?
Thanks,
Daniel
Request clarification before answering.
Have you tried to follow the example in:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Recursive type are indeed not supported in CDS. Before we would invest in this direction, we would have to check whether they would be supported in consumers of CDS models.
In SQL, it would be fine in combination with MANY (like your example), because then it would be mapped to a CLOB... In OData and OData consumers...
In CDS, you have recursive data structures via Associations/compositions
entity Node {
key id: UUID;
value: String;
children: Composition of Node;
}
Regards,
Christoph
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 15 | |
| 9 | |
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.