-
Notifications
You must be signed in to change notification settings - Fork 124
Java: Views and Projections #1916
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
base: main
Are you sure you want to change the base?
Conversation
Select BooksWithLowStock where author = 'Kafka' | ||
``` | ||
|
||
CAP Java provides two modes for resolving runtime views: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How developers should decide which mode to use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add recommendations later with experience from app development. Currently cte
mode is the new default in 4.x
with less limitations.
- The projection must not include [path expressions](../../cds/cql#path-expressions) using to-many associations. | ||
- Projections targeting remote OData services must not include calculated elements. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can view include mixin associations or compositions? What will be writable then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, these restrictions at least partially apply to the views in general, right? Are they described somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a section on deep write via views
|
||
Views and projections can be resolved for write operations if the following conditions are met: | ||
|
||
- The view definition does not use any other clause than `columns` and `excluding` - `join`, `union` and `where` are not supported. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the example above where
is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where
is supported in runtime views (on read), but currently not on write. The "Write through Views" section is not specific to runtime views but to views in general.
Introduces "Views and Projections" section with
and documents some rules for write via path expressions in views.
Also shortens some headers to improve the readability in the navigation bar.