-
Notifications
You must be signed in to change notification settings - Fork 149
[Java] Document references #2153
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?
Changes from 1 commit
e0c19c6
3cfdad1
36fbf31
801631e
caa3892
b1a24dd
92a0ac3
f295189
0f14609
fb7591f
7a5c3c3
5d740ce
4a67d72
2e7d155
51b74cd
91b2f00
5002237
1b1f731
881693f
278e74a
46ecab7
b47d480
761a620
483e0a9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -131,7 +131,6 @@ In the [CDS Query Language (CQL)](/cds/cql) builder, the lambda expression `o -> | |||||
| To target components of a structured document, we recommend using path expressions with infix filters. | ||||||
| ::: | ||||||
|
|
||||||
|
|
||||||
| ### Filters {#target-entity-filters} | ||||||
|
|
||||||
| Besides using infix filters in path expressions, the `Select`, `Update`, and `Delete` builders support filtering the [target entity set](#target-entity-sets) via the `where` method. Using `where` is equivalent to defining an infix filter on the last segment of a path expression in the statement's `from` / `entity` clause. For statements that have both, an infix filter on the last path segment and a `where` filter, the resulting target filter is the conjunction (`and`) of the infix filter and the `where` filter. | ||||||
|
|
@@ -1309,7 +1308,26 @@ The Query Builder API supports using expressions in many places. Expressions con | |||||
|
|
||||||
| ### Entity References {#entity-refs} | ||||||
|
|
||||||
| Entity references specify entity sets. They can be used to define the target entity set of a [CQL](../../cds/cql) statement. They can either be defined inline using lambda expressions in the Query Builder (see [Target Entity Sets](#target-entity-sets)) or via the `CQL.entity` method, which is available in an _untyped_ version as well as in a _typed_ version that uses the generated [model interfaces](../cqn-services/persistence-services#model-interfaces). The following example shows an entity reference describing the set of *authors* that have published books in the year 2020: | ||||||
| Entity references specify entity sets. They can be used to define the target entity set of a [CQL](../../cds/cql) statement or be an argument of event handler. | ||||||
|
|
||||||
| You can also get [entity references](query-execution#entity-refs) from the result of a CDS QL statement to address an entity via its key values in other statements. | ||||||
|
|
||||||
| Each reference has ordered sequence of _segments_ that define the path from the entity's root to the certain part of it. Segment has the _identifier_ with the name of the entity or an element and optional filter _predicate_. | ||||||
|
|
||||||
| Existing reference can be reused as an object or a variable, or a new reference can be built on top of it. References are not bound to the particular model and are not checked against it while they are being built. | ||||||
|
||||||
| Existing reference can be reused as an object or a variable, or a new reference can be built on top of it. References are not bound to the particular model and are not checked against it while they are being built. | |
| An existing reference can be reused as an object or a variable, or a new reference can be built on top of it. References are not bound to the particular model and are not checked against it while they are being built. |
Outdated
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.
| References can be _absolute_ or _relative_. Absolute reference has fully qualified entity name as the identifier in the first segment. They usually have associations as their segments. | |
| References can be _absolute_ or _relative_. An absolute reference has a fully qualified entity name as the identifier in the first segment. They usually have associations as their segments. |
Outdated
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.
| You start with the reference pointing to a book with certain key. You build it using corresponding [model interfaces](../cqn-services/persistence-services#model-interfaces) providing you the methods that corresponds to the elements of the book. | |
| You start with the reference pointing to a book with a certain key. You build it using corresponding [model interfaces](../cqn-services/persistence-services#model-interfaces) providing you the methods that corresponds to the elements of the book. |
vmikhailenko marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
vmikhailenko marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Outdated
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.
| You can also construct ref that starts from the first segment to navigate to different path of the same root. | |
| You can also construct a ref that starts from the first segment to navigate to different path of the same root. |
Outdated
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.
Spelling error: 'Elements References' should be 'Element References' (singular form is more appropriate for a heading about the concept).
Outdated
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.
Grammar error: The heading should be 'Element References' (not 'Elements References') to maintain consistency with the singular form used elsewhere in the document.
renejeglinsky marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
renejeglinsky marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
renejeglinsky marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Outdated
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.
| Element references can be extended with the same APIs as the entity references. | |
| Element references can be extended with the same APIs as the [entity references](#entity-refs). |
renejeglinsky marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Outdated
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.
Use active voice and improve clarity. Change 'They also share the same features and limitations as the entity references and they cannot be used with' to 'Element references share the same features and limitations as entity references and cannot be used with' to avoid repetition and make it more concise.
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.