Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add limiation section for deep write #1611

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

johannes-vogel
Copy link
Contributor

@agoerler @beckermarc Please double check whether these limitations also apply to CAP Java.

@renejeglinsky Do we have a better pattern to signal good/bad?

Comment on lines 305 to 306
1. The on-condition of the composition only uses `=` operator
2. Expressions are combined with the logical operator `AND`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and no negation not(...)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also for deep writes?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't support writing via on-conditions using negation.
not(...) can be rewritten using !=, which is covered by condition 1.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

somehow I misread the initial comment and though you do support not(...).
In essence, you also only support AND. OR/NOT are not supported generically?!.

We could emphasize this with

Suggested change
1. The on-condition of the composition only uses `=` operator
2. Expressions are combined with the logical operator `AND`
2. The predicates are only connected with the logical operator `AND`

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's correct, writing via on-conditions using OR or NOT is not supported.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed the sentence now to above proposal. fine for you?

Comment on lines +322 to +335

Bad:
```cds
entity Orders {
key ID : UUID;
title : String;
Items : Composition of many OrderItems on substring(title, 0, 1) <= 'F' or Items.pos > 12;
}
entity OrderItems {
key order : Association to Orders;
key pos : Integer;
descr: String;
}
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would avoid bad examples in the documentation There's always a risk that someone copies them.

guides/providing-services.md Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants