From 44bc91a6e6b72ebe225fd104173e38f81fde713c Mon Sep 17 00:00:00 2001 From: Robin de Silva Jayasinghe Date: Fri, 7 Nov 2025 14:16:43 +0100 Subject: [PATCH 01/13] add section for CAP Java OpenRewrite recipes --- java/migration.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/java/migration.md b/java/migration.md index 1697c152b1..9fdc2f4218 100644 --- a/java/migration.md +++ b/java/migration.md @@ -1414,3 +1414,24 @@ After rebuilding and restarting your application, your Application Services are + +## Automatic Java Migrations with Open Rewrite { #open-rewrite } + +Whenever we introduce new versions or replacements of an API version we try make the transition from the old version to the new version as smooth as possible. When possible we introduce a new version in the same major version as the version where deprecate the old version. This is the foundation for having automatic code migrations with [OpenRewrite](https://docs.openrewrite.org). At CAP Java, we aim to provide Open Rewrite Recipes for our API changes. + +The application of these recipes is done via Maven similarly to calling Maven archetypes these recipes are called as a one-shot operation on a developers laptop. Take this call as an example: + +```bash +mvn org.openrewrite.maven:rewrite-maven-plugin:run \ + -Drewrite.recipeArtifactCoordinates=com.sap.cds:cds-services-recipes:4.3.0 \ + -Drewrite.activeRecipes=com.sap.cds.services.migrations.MigrateStatements \ + -DskipMavenParsing=true +``` + +Here, the *migration* `com.sap.cds.services.migrations.MigrateStatements` in the Maven artifact `com.sap.cds:cds-services-recipes:4.3.0` is called in the given project context. The *migration* is a container for one or more recipes. A recipe is a rule telling Open Rewrite how to come from code A to code B. + +This is the list of migrations we have released for CAP Java: + +|Name |Description|Available since| +|--------|-----------|---------------| +|[com.sap.cds.services.migrations.MigrateStatements](./releases/aug25#typed-query-results)|Prepares applications by migrating CQN statements for typed Query API changes in 4.3.0.|4.3.0| \ No newline at end of file From 25f55eca18e3ff26edf6b684b31946e166f5ed2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Jeglinsky?= Date: Tue, 11 Nov 2025 21:13:22 +0100 Subject: [PATCH 02/13] Update java/migration.md --- java/migration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/migration.md b/java/migration.md index 9fdc2f4218..6ea130f559 100644 --- a/java/migration.md +++ b/java/migration.md @@ -1434,4 +1434,4 @@ This is the list of migrations we have released for CAP Java: |Name |Description|Available since| |--------|-----------|---------------| -|[com.sap.cds.services.migrations.MigrateStatements](./releases/aug25#typed-query-results)|Prepares applications by migrating CQN statements for typed Query API changes in 4.3.0.|4.3.0| \ No newline at end of file +|[com.sap.cds.services.migrations.MigrateStatements](/releases/aug25#typed-query-results)|Prepares applications by migrating CQN statements for typed Query API changes in 4.3.0.|4.3.0| \ No newline at end of file From ebe182dc2e2530ec629368614f007988f5383e2b Mon Sep 17 00:00:00 2001 From: Robin de Silva Jayasinghe Date: Wed, 12 Nov 2025 15:54:01 +0100 Subject: [PATCH 03/13] address review comments --- java/migration.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/java/migration.md b/java/migration.md index 6ea130f559..d779c4edf5 100644 --- a/java/migration.md +++ b/java/migration.md @@ -1415,11 +1415,11 @@ After rebuilding and restarting your application, your Application Services are -## Automatic Java Migrations with Open Rewrite { #open-rewrite } +## Automatic Java Migrations with OpenRewrite { #open-rewrite } -Whenever we introduce new versions or replacements of an API version we try make the transition from the old version to the new version as smooth as possible. When possible we introduce a new version in the same major version as the version where deprecate the old version. This is the foundation for having automatic code migrations with [OpenRewrite](https://docs.openrewrite.org). At CAP Java, we aim to provide Open Rewrite Recipes for our API changes. +Whenever we introduce new versions or replacements of an API version, we try to make the transition from the old version to the new version as smooth as possible. When possible we introduce a new version in the same major version as the version where deprecate the old version. This is the foundation for having automatic code migrations with [OpenRewrite](https://docs.openrewrite.org). At CAP Java, we aim to provide OpenRewrite Recipes for our API changes. -The application of these recipes is done via Maven similarly to calling Maven archetypes these recipes are called as a one-shot operation on a developers laptop. Take this call as an example: +The application of these recipes is done via Maven as a one-shot operation on a developer's laptop, similar to calling Maven archetypes. Take this call as an example: ```bash mvn org.openrewrite.maven:rewrite-maven-plugin:run \ @@ -1428,10 +1428,10 @@ mvn org.openrewrite.maven:rewrite-maven-plugin:run \ -DskipMavenParsing=true ``` -Here, the *migration* `com.sap.cds.services.migrations.MigrateStatements` in the Maven artifact `com.sap.cds:cds-services-recipes:4.3.0` is called in the given project context. The *migration* is a container for one or more recipes. A recipe is a rule telling Open Rewrite how to come from code A to code B. +Here, the *migration* `com.sap.cds.services.migrations.MigrateStatements` in the Maven artifact `com.sap.cds:cds-services-recipes:4.3.0` is called in the given project context. The *migration* is a container for one or more recipes. A recipe is a rule that tells OpenRewrite how to transform code from version A to version B. This is the list of migrations we have released for CAP Java: |Name |Description|Available since| |--------|-----------|---------------| -|[com.sap.cds.services.migrations.MigrateStatements](/releases/aug25#typed-query-results)|Prepares applications by migrating CQN statements for typed Query API changes in 4.3.0.|4.3.0| \ No newline at end of file +|[com.sap.cds.services.migrations.MigrateStatements](/releases/aug25#typed-query-results)|Prepares applications by migrating CQN statements for typed Query API changes in 4.3.0.|4.3.0| From 53a2064698d162fc678352db1f9ad8f5b51b2662 Mon Sep 17 00:00:00 2001 From: Robin de Silva Jayasinghe Date: Tue, 24 Feb 2026 13:46:36 +0100 Subject: [PATCH 04/13] apply review comments --- java/migration.md | 48 +++++++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/java/migration.md b/java/migration.md index d779c4edf5..10a53f9978 100644 --- a/java/migration.md +++ b/java/migration.md @@ -23,6 +23,34 @@ uacp: Used as link target from Help Portal at https://help.sap.com/products/BTP/ [[toc]] + +## Automatic Java Migrations with OpenRewrite { #open-rewrite } + +For any Java related changes of the CAP Java APIs we try to make the transition from the old version to the new version as smooth as possible. Consequently, we provide a [OpenRewrite](https://docs.openrewrite.org) with migrations for our API changes so that larger projects can easily consume them. + +### Moderne Platform + +The CAP Java OpenRewrite recipe with our migrations can be found and used in the Moderne Platform. + +### Local Execution of OpenRewrite Recipes + +Alternatively, the application of these recipes is done via Maven as a one-shot operation on a developer's laptop, similar to calling Maven archetypes. Take this call as an example: + +```bash +mvn org.openrewrite.maven:rewrite-maven-plugin:run \ + -Drewrite.recipeArtifactCoordinates=com.sap.cds:cds-services-recipes:4.3.0 \ + -Drewrite.activeRecipes=com.sap.cds.services.migrations.MigrateStatements \ + -DskipMavenParsing=true +``` + +Here, the *migration* `com.sap.cds.services.migrations.MigrateStatements` in the Maven artifact `com.sap.cds:cds-services-recipes:4.3.0` is called in the given project context. The *migration* is a container for one or more recipes. A recipe is a rule that tells OpenRewrite how to transform code from version A to version B. + +### Currently Released CAP Java Migrations + +|Name |Description|Available since| +|--------|-----------|---------------| +|[com.sap.cds.services.migrations.MigrateStatements](/releases/aug25#typed-query-results)|Prepares applications by migrating CQN statements for typed Query API changes in 4.3.0.|4.3.0| + ## CAP Java 3.10 to CAP Java 4.0 { #three-to-four } ### New License @@ -1415,23 +1443,3 @@ After rebuilding and restarting your application, your Application Services are -## Automatic Java Migrations with OpenRewrite { #open-rewrite } - -Whenever we introduce new versions or replacements of an API version, we try to make the transition from the old version to the new version as smooth as possible. When possible we introduce a new version in the same major version as the version where deprecate the old version. This is the foundation for having automatic code migrations with [OpenRewrite](https://docs.openrewrite.org). At CAP Java, we aim to provide OpenRewrite Recipes for our API changes. - -The application of these recipes is done via Maven as a one-shot operation on a developer's laptop, similar to calling Maven archetypes. Take this call as an example: - -```bash -mvn org.openrewrite.maven:rewrite-maven-plugin:run \ - -Drewrite.recipeArtifactCoordinates=com.sap.cds:cds-services-recipes:4.3.0 \ - -Drewrite.activeRecipes=com.sap.cds.services.migrations.MigrateStatements \ - -DskipMavenParsing=true -``` - -Here, the *migration* `com.sap.cds.services.migrations.MigrateStatements` in the Maven artifact `com.sap.cds:cds-services-recipes:4.3.0` is called in the given project context. The *migration* is a container for one or more recipes. A recipe is a rule that tells OpenRewrite how to transform code from version A to version B. - -This is the list of migrations we have released for CAP Java: - -|Name |Description|Available since| -|--------|-----------|---------------| -|[com.sap.cds.services.migrations.MigrateStatements](/releases/aug25#typed-query-results)|Prepares applications by migrating CQN statements for typed Query API changes in 4.3.0.|4.3.0| From c28c3667b449487a783a74596a529d32f7bdb839 Mon Sep 17 00:00:00 2001 From: Robin de Silva Jayasinghe Date: Tue, 24 Feb 2026 14:20:33 +0100 Subject: [PATCH 05/13] apply review comments and fix link --- java/migration.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/java/migration.md b/java/migration.md index e2c5bf5e5e..3e3b9eaf40 100644 --- a/java/migration.md +++ b/java/migration.md @@ -23,7 +23,7 @@ uacp: Used as link target from Help Portal at https://help.sap.com/products/BTP/ [[toc]] -## Automatic Java Migrations with OpenRewrite { #open-rewrite } +## Automatic CAP Java Migrations with OpenRewrite { #open-rewrite } For any Java related changes of the CAP Java APIs we try to make the transition from the old version to the new version as smooth as possible. Consequently, we provide a [OpenRewrite](https://docs.openrewrite.org) with migrations for our API changes so that larger projects can easily consume them. @@ -42,13 +42,13 @@ mvn org.openrewrite.maven:rewrite-maven-plugin:run \ -DskipMavenParsing=true ``` -Here, the *migration* `com.sap.cds.services.migrations.MigrateStatements` in the Maven artifact `com.sap.cds:cds-services-recipes:4.3.0` is called in the given project context. The *migration* is a container for one or more recipes. A recipe is a rule that tells OpenRewrite how to transform code from version A to version B. +Here, the *migration* `com.sap.cds.services.migrations.MigrateStatements` in the Maven artifact `com.sap.cds:cds-services-recipes:4.3.0` is called in the given project context. The *migration* is a container for one or more recipes. A recipe is a rule that tells OpenRewrite how to transform code. ### Currently Released CAP Java Migrations |Name |Description|Available since| |--------|-----------|---------------| -|[com.sap.cds.services.migrations.MigrateStatements](/releases/aug25#typed-query-results)|Prepares applications by migrating CQN statements for typed Query API changes in 4.3.0.|4.3.0| +|[com.sap.cds.services.migrations.MigrateStatements](../releases/aug25#typed-query-results)|Migrates CQN statements to comply with typed Query API changes in 4.3.0.|4.3.0| ## CAP Java 3.10 to CAP Java 4.0 { #three-to-four } From b3950d54ecc6cc7569e6791ee60ee445260437b0 Mon Sep 17 00:00:00 2001 From: Robin de Silva Jayasinghe Date: Wed, 25 Feb 2026 15:42:42 +0100 Subject: [PATCH 06/13] fix link --- java/migration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/migration.md b/java/migration.md index 3e3b9eaf40..f23574897c 100644 --- a/java/migration.md +++ b/java/migration.md @@ -48,7 +48,7 @@ Here, the *migration* `com.sap.cds.services.migrations.MigrateStatements` in the |Name |Description|Available since| |--------|-----------|---------------| -|[com.sap.cds.services.migrations.MigrateStatements](../releases/aug25#typed-query-results)|Migrates CQN statements to comply with typed Query API changes in 4.3.0.|4.3.0| +|[com.sap.cds.services.migrations.MigrateStatements](../releases/2025/aug25#typed-query-results)|Migrates CQN statements to comply with typed Query API changes in 4.3.0.|4.3.0| ## CAP Java 3.10 to CAP Java 4.0 { #three-to-four } From 253c0691059f189c4c847becdb84612052251c8c Mon Sep 17 00:00:00 2001 From: Robin Date: Thu, 26 Feb 2026 09:28:11 +0100 Subject: [PATCH 07/13] Apply suggestions from code review Co-authored-by: Marc Becker --- java/migration.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java/migration.md b/java/migration.md index f23574897c..2e52974c25 100644 --- a/java/migration.md +++ b/java/migration.md @@ -25,7 +25,7 @@ uacp: Used as link target from Help Portal at https://help.sap.com/products/BTP/ ## Automatic CAP Java Migrations with OpenRewrite { #open-rewrite } -For any Java related changes of the CAP Java APIs we try to make the transition from the old version to the new version as smooth as possible. Consequently, we provide a [OpenRewrite](https://docs.openrewrite.org) with migrations for our API changes so that larger projects can easily consume them. +For any Java related changes of the CAP Java APIs we try to make the transition from the old version to the new version as smooth as possible. Consequently, we provide [OpenRewrite recipes](https://docs.openrewrite.org) with migrations for our API changes so that larger projects can easily consume them. ### Moderne Platform @@ -42,7 +42,7 @@ mvn org.openrewrite.maven:rewrite-maven-plugin:run \ -DskipMavenParsing=true ``` -Here, the *migration* `com.sap.cds.services.migrations.MigrateStatements` in the Maven artifact `com.sap.cds:cds-services-recipes:4.3.0` is called in the given project context. The *migration* is a container for one or more recipes. A recipe is a rule that tells OpenRewrite how to transform code. +Here, the *migration* `com.sap.cds.services.migrations.MigrateStatements` from CAP Java's OpenRewrite Maven artifact `com.sap.cds:cds-services-recipes` is called in the given project context. The *migration* is a container for one or more recipes. A recipe is a rule that tells OpenRewrite how to transform code. ### Currently Released CAP Java Migrations From a4a9790bc3d5d24f66a9f3d0ad79b3940b410f9a Mon Sep 17 00:00:00 2001 From: Robin de Silva Jayasinghe Date: Thu, 26 Feb 2026 10:04:27 +0100 Subject: [PATCH 08/13] use the versions variable --- java/migration.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/java/migration.md b/java/migration.md index 2e52974c25..1de647d4ba 100644 --- a/java/migration.md +++ b/java/migration.md @@ -1,5 +1,5 @@ --- -synopsis: > +synopsis: This chapter contains comprehensive guides that help you to work through migrations such as from CAP Java 1.x to CAP Java 2.x. uacp: Used as link target from Help Portal at https://help.sap.com/products/BTP/65de2977205c403bbc107264b8eccf4b/9186ed9ab00842e1a31309ff1be38792.html --- @@ -7,6 +7,9 @@ uacp: Used as link target from Help Portal at https://help.sap.com/products/BTP/ @@ -37,7 +40,7 @@ Alternatively, the application of these recipes is done via Maven as a one-shot ```bash mvn org.openrewrite.maven:rewrite-maven-plugin:run \ - -Drewrite.recipeArtifactCoordinates=com.sap.cds:cds-services-recipes:4.3.0 \ + -Drewrite.recipeArtifactCoordinates=com.sap.cds:cds-services-recipes:$the_latest_cap_java_version \ -Drewrite.activeRecipes=com.sap.cds.services.migrations.MigrateStatements \ -DskipMavenParsing=true ``` From aa8c4cff4df08d4173b66fc09bf2a552078eb276 Mon Sep 17 00:00:00 2001 From: Robin de Silva Jayasinghe Date: Thu, 26 Feb 2026 10:15:16 +0100 Subject: [PATCH 09/13] generalize wording; --- java/migration.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java/migration.md b/java/migration.md index 1de647d4ba..74e77da9d0 100644 --- a/java/migration.md +++ b/java/migration.md @@ -34,9 +34,9 @@ For any Java related changes of the CAP Java APIs we try to make the transition The CAP Java OpenRewrite recipe with our migrations can be found and used in the Moderne Platform. -### Local Execution of OpenRewrite Recipes +### Execution of OpenRewrite Recipes with Maven -Alternatively, the application of these recipes is done via Maven as a one-shot operation on a developer's laptop, similar to calling Maven archetypes. Take this call as an example: +Alternatively, the application of these recipes is done via Maven as a one-shot operation. Take this call as an example: ```bash mvn org.openrewrite.maven:rewrite-maven-plugin:run \ From 4e81a965d4523a4d0e4e9b8e89e3cd1a615a278a Mon Sep 17 00:00:00 2001 From: Christian Georgi Date: Thu, 26 Feb 2026 12:59:41 +0100 Subject: [PATCH 10/13] Fix java version variable --- java/migration.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/java/migration.md b/java/migration.md index 74e77da9d0..91b1cdb81f 100644 --- a/java/migration.md +++ b/java/migration.md @@ -1,5 +1,5 @@ --- -synopsis: +synopsis: This chapter contains comprehensive guides that help you to work through migrations such as from CAP Java 1.x to CAP Java 2.x. uacp: Used as link target from Help Portal at https://help.sap.com/products/BTP/65de2977205c403bbc107264b8eccf4b/9186ed9ab00842e1a31309ff1be38792.html --- @@ -38,9 +38,9 @@ The CAP Java OpenRewrite recipe with our migrations can be found and used in the Alternatively, the application of these recipes is done via Maven as a one-shot operation. Take this call as an example: -```bash +```bash-vue mvn org.openrewrite.maven:rewrite-maven-plugin:run \ - -Drewrite.recipeArtifactCoordinates=com.sap.cds:cds-services-recipes:$the_latest_cap_java_version \ + -Drewrite.recipeArtifactCoordinates=com.sap.cds:cds-services-recipes:{{ versions.java_services }} \ -Drewrite.activeRecipes=com.sap.cds.services.migrations.MigrateStatements \ -DskipMavenParsing=true ``` From 8524c0c0e6cc2d6a8635f355556fa0ab8062aaf2 Mon Sep 17 00:00:00 2001 From: Marc Becker Date: Fri, 27 Feb 2026 13:03:38 +0100 Subject: [PATCH 11/13] Update java/migration.md --- java/migration.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/java/migration.md b/java/migration.md index 91b1cdb81f..e67b681dd1 100644 --- a/java/migration.md +++ b/java/migration.md @@ -30,13 +30,9 @@ uacp: Used as link target from Help Portal at https://help.sap.com/products/BTP/ For any Java related changes of the CAP Java APIs we try to make the transition from the old version to the new version as smooth as possible. Consequently, we provide [OpenRewrite recipes](https://docs.openrewrite.org) with migrations for our API changes so that larger projects can easily consume them. -### Moderne Platform +### Running OpenRewrite Recipes -The CAP Java OpenRewrite recipe with our migrations can be found and used in the Moderne Platform. - -### Execution of OpenRewrite Recipes with Maven - -Alternatively, the application of these recipes is done via Maven as a one-shot operation. Take this call as an example: +You can execute these recipes through Maven as a one-shot operation. Take this call as an example: ```bash-vue mvn org.openrewrite.maven:rewrite-maven-plugin:run \ From beff2674efa5120c72c7184da45eb79e739bfe6a Mon Sep 17 00:00:00 2001 From: Robin de Silva Jayasinghe Date: Mon, 2 Mar 2026 12:25:55 +0100 Subject: [PATCH 12/13] correction after review --- java/migration.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/java/migration.md b/java/migration.md index e67b681dd1..88d7228514 100644 --- a/java/migration.md +++ b/java/migration.md @@ -34,6 +34,10 @@ For any Java related changes of the CAP Java APIs we try to make the transition You can execute these recipes through Maven as a one-shot operation. Take this call as an example: +### Execution of OpenRewrite Recipes with Maven + +Alternatively, you can run these recipes through Maven. Take this call as an example: + ```bash-vue mvn org.openrewrite.maven:rewrite-maven-plugin:run \ -Drewrite.recipeArtifactCoordinates=com.sap.cds:cds-services-recipes:{{ versions.java_services }} \ From 7b5707ce6d3c00e2db646f97dfc376bfc0d4323a Mon Sep 17 00:00:00 2001 From: Robin Date: Mon, 2 Mar 2026 12:38:33 +0100 Subject: [PATCH 13/13] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: René Jeglinsky --- java/migration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/migration.md b/java/migration.md index 88d7228514..1c43bbe58a 100644 --- a/java/migration.md +++ b/java/migration.md @@ -26,7 +26,7 @@ uacp: Used as link target from Help Portal at https://help.sap.com/products/BTP/ [[toc]] -## Automatic CAP Java Migrations with OpenRewrite { #open-rewrite } +## Automatic CAP Java Migrations with OpenRewrite For any Java related changes of the CAP Java APIs we try to make the transition from the old version to the new version as smooth as possible. Consequently, we provide [OpenRewrite recipes](https://docs.openrewrite.org) with migrations for our API changes so that larger projects can easily consume them.