From 6cb8eb13d675210c7ef30c0da1657e1dcc7fc01c Mon Sep 17 00:00:00 2001 From: Matthias Schur <107557548+MattSchur@users.noreply.github.com> Date: Thu, 24 Jul 2025 13:55:59 +0200 Subject: [PATCH 1/2] Java: `cascade.delete` hint --- java/working-with-cql/query-execution.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/java/working-with-cql/query-execution.md b/java/working-with-cql/query-execution.md index 699ab183d..1df4b3388 100644 --- a/java/working-with-cql/query-execution.md +++ b/java/working-with-cql/query-execution.md @@ -218,10 +218,13 @@ The [delete](./query-api) operation is cascaded along the entity's compositions. The following example deletes the order with ID *1000* including all its items: ```java -CqnDelete delete = Delete.from("bookshop.Orders").matching(singletonMap("OrderNo", 1000)); -long deleteCount = service.run(delete).rowCount(); +long deleteCount = service.run(Delete.from("bookshop.Orders").byId(1000)).rowCount(); ``` +::: tip +To disable cascade delete for a specific Delete statement, add a `cascade.delete` hint(#hana-hints) with value `false`. +::: + ## Views and Projections { #views } With CDS [views](../../cds/cdl#views-projections) you can derive new entities from existing ones, for example to rename or exclude certain elements, or to add [virtual elements](../../cds/cdl#virtual-elements-in-views) for specific use cases. From 1d84d3cb8502b06d4ce617756bed9d4e8f1d3625 Mon Sep 17 00:00:00 2001 From: Matthias Schur <107557548+MattSchur@users.noreply.github.com> Date: Thu, 24 Jul 2025 14:52:47 +0200 Subject: [PATCH 2/2] Update query-execution.md --- java/working-with-cql/query-execution.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/java/working-with-cql/query-execution.md b/java/working-with-cql/query-execution.md index 1df4b3388..e3c953b50 100644 --- a/java/working-with-cql/query-execution.md +++ b/java/working-with-cql/query-execution.md @@ -222,7 +222,10 @@ long deleteCount = service.run(Delete.from("bookshop.Orders").byId(1000)).rowCou ``` ::: tip -To disable cascade delete for a specific Delete statement, add a `cascade.delete` hint(#hana-hints) with value `false`. +To disable cascade delete for a specific Delete statement, add a hint(#hana-hints): +```Java +Delete.from("bookshop.Orders").byId(1000).hint("cascade.delete", false); +``` ::: ## Views and Projections { #views }