From 5f47917344f6847437aa79b11f67fe166167fd59 Mon Sep 17 00:00:00 2001 From: Steffen Weinstock <79531202+stewsk@users.noreply.github.com> Date: Tue, 21 Jul 2026 10:09:58 +0200 Subject: [PATCH 1/2] Clarify ":1" syntax in infix filter --- cds/cdl.md | 7 +++++++ cds/cql.md | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/cds/cdl.md b/cds/cdl.md index 48cad8ff5f..823bd4ceb8 100644 --- a/cds/cdl.md +++ b/cds/cdl.md @@ -1164,6 +1164,13 @@ entity P_Employees as projection on Employees { } ``` +::: warning Limitations of Compositions of one +The `:1` syntax in the filter has no effect on the result. It is only an information by the developer +that the specified condition reduces the result to a single entry. If the condition doesn't reduce +the result set to one entry, you must not add `:1`. +::: + + Filters usually are provided only for to-many associations, which usually are unmanaged. Thus publishing with a filter is almost exclusively used for unmanaged associations. Nevertheless you can also publish a managed association with a filter. This will automatically diff --git a/cds/cql.md b/cds/cql.md index 3e2abae87e..2f8ba3059d 100644 --- a/cds/cql.md +++ b/cds/cql.md @@ -354,6 +354,12 @@ If an infix filter effectively reduces the cardinality of a *to-many* associatio SELECT name, books[1: favorite=true].title from Authors ``` +::: warning Limitations of Compositions of one +The `:1` syntax in the filter has no effect on the result. It is only an information by the developer +that the specified condition reduces the result to a single entry. If the condition doesn't reduce +the result set to one entry, you must not add `:1`. +::: + ### Exists Predicate Use a filtered path expression to test if any element of the associated collection matches the given filter: From cf38b28ec306643273a19bafe8af95b1530da11c Mon Sep 17 00:00:00 2001 From: Steffen Weinstock <79531202+stewsk@users.noreply.github.com> Date: Tue, 21 Jul 2026 15:14:09 +0200 Subject: [PATCH 2/2] clarification --- cds/cdl.md | 9 ++++----- cds/cql.md | 5 ++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/cds/cdl.md b/cds/cdl.md index 823bd4ceb8..0f117c6edb 100644 --- a/cds/cdl.md +++ b/cds/cdl.md @@ -1154,7 +1154,7 @@ entity P_Authors as projection on Authors { In this example, in addition to `books` projection `P_Authors` has a new association `availableBooks` that points only to those books where `stock > 0`. -If the filter condition effectively reduces the cardinality of the association +If the filter condition effectively reduces the cardinality of the association (or composition) to one, you should make this explicit in the filter by adding a `1:` before the condition: ```cds @@ -1164,10 +1164,9 @@ entity P_Employees as projection on Employees { } ``` -::: warning Limitations of Compositions of one -The `:1` syntax in the filter has no effect on the result. It is only an information by the developer -that the specified condition reduces the result to a single entry. If the condition doesn't reduce -the result set to one entry, you must not add `:1`. +::: warning `:1` doesn't itself reduce the cardinality +The `:1` syntax itself has no effect on the cardinality. It is only an information by the developer +that the specified condition reduces the cardinality of the association or composition to one. ::: diff --git a/cds/cql.md b/cds/cql.md index 2f8ba3059d..dfe91df2b4 100644 --- a/cds/cql.md +++ b/cds/cql.md @@ -354,10 +354,9 @@ If an infix filter effectively reduces the cardinality of a *to-many* associatio SELECT name, books[1: favorite=true].title from Authors ``` -::: warning Limitations of Compositions of one +::: warning `:1` has no effect on result set The `:1` syntax in the filter has no effect on the result. It is only an information by the developer -that the specified condition reduces the result to a single entry. If the condition doesn't reduce -the result set to one entry, you must not add `:1`. +that the specified condition reduces the result to a single entry. ::: ### Exists Predicate