Skip to content

Commit f016c41

Browse files
authored
Deprecations and removals in CAP Java 5 (#2479)
Added sections for adjusted, deprecated, and removed properties, as well as removed Java APIs in migration documentation.
1 parent 33f4e26 commit f016c41

1 file changed

Lines changed: 46 additions & 3 deletions

File tree

java/migration.md

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,21 @@ As migration is a one-time operation, run the OpenRewrite `recipes` as a command
3737
```bash-vue
3838
mvn org.openrewrite.maven:rewrite-maven-plugin:run \
3939
-Drewrite.recipeArtifactCoordinates=com.sap.cds:cds-services-recipes:{{ versions.java_services }} \
40-
-Drewrite.activeRecipes=com.sap.cds.services.migrations.MigrateStatements \
41-
-DskipMavenParsing=true
40+
-Drewrite.activeRecipes=com.sap.cds.services.recipes.Cap_4.9
4241
```
4342

44-
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.
43+
Here, the *recipe* `com.sap.cds.services.recipes.Cap_4.9` from CAP Java's OpenRewrite Maven artifact `com.sap.cds:cds-services-recipes` is called in the given project context. The *recipe* is a container for one or more recipes. A recipe is a rule that tells OpenRewrite how to transform code.
4544

4645
### Currently Released CAP Java Migrations
4746

47+
The following table lists the individual recipes provided by CAP for APIs that have been deprecated and are subject for removal. Besides these fine grained recipes, course grained recipes might be provided per release (e.g. `com.sap.cds.services.recipes.Cap_4.9`). These type of recipes include all recipes for APIs deprecated in this AND previous releases. Consequently, it is sufficient to execute the latest recipe matching the version of the CAP Java SDK you are upgrading to.
48+
4849
|Name |Description|Available since|
4950
|--------|-----------|---------------|
5051
|[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|
52+
|[com.sap.cds.services.migrations.ServiceExceptionUtils](#removed-java-apis-4-to-5)|Replaces deprecated methods in `ServiceExceptionUtils`.|4.9.0|
53+
|[com.sap.cds.services.migrations.MigrateSaasRegistryDependency](#removed-java-apis-4-to-5)|Replaces deprecated `SaasRegistryDependency` methods `setAppId`/`setAppName`/`getAppId`/`getAppName` with their `xsappname`-based replacements.|4.9.0|
54+
|[com.sap.cds.services.recipes.UclMigration](#removed-java-apis-4-to-5)|Migrates deprecated UCL result getter and setter methods to the new API.|4.9.0|
5155

5256
## CAP Java 4.9 to CAP Java 5.0 (TBA) { #four-to-five }
5357

@@ -66,6 +70,45 @@ CAP Java 5.0 increased some minimum required versions:
6670
| Spring Boot | 4.0 |
6771
| XSUAA (BTP Security Library) | 4.0.0 |
6872

73+
### Adjusted Property Defaults
74+
75+
Some property defaults have been adjusted:
76+
77+
| Property | Old Value | New Value | Explanation |
78+
| --- | --- | --- | --- |
79+
| `abc` | false | true | Any description. |
80+
81+
### Deprecated Properties
82+
83+
The following properties have been deprecated and might be removed in a future major version:
84+
85+
- `abd`
86+
87+
The functionality provided by these properties is enabled by default. This reflects its intended behavior once the properties are deleted in future releases.
88+
89+
### Removed Properties
90+
91+
The following table gives an overview about the removed properties:
92+
93+
| Removed Property | Replacement / Explanation |
94+
| --- | --- |
95+
| `abc` | Any description about replacement |
96+
97+
### Removed Java APIs { #removed-java-apis-4-to-5 }
98+
99+
- Removed deprecated methods:
100+
- `com.sap.cds.feature.ucl.services.AssignEventContext.setUclResult(SpiiResult)``setResult(SpiiResult)`
101+
- `com.sap.cds.feature.ucl.services.AssignEventContext.getUclResult()``getResult()`
102+
- `com.sap.cds.services.mt.SaaSRegistryDependency.getAppId()``getXsappname()`
103+
- `com.sap.cds.services.mt.SaaSRegistryDependency.setAppId(String appId)``setXsappname(appId)`
104+
- `com.sap.cds.services.mt.SaaSRegistryDependency.getAppName()``getXsappname()`
105+
- `com.sap.cds.services.mt.SaaSRegistryDependency.setAppName(String appName)``setXsappname(appName)`
106+
- `com.sap.cds.services.ServiceExceptionUtils.getLocalizedMessage(String code, Object[] args, Locale locale)``getLocalizedMessage(code, args, locale, true)` (pass `true` for `errorStatusFallback` to keep the previous behavior)
107+
- `com.sap.cds.services.ServiceExceptionUtils.getMessageTarget(Path path, CdsElement element)``MessageTarget.create(path, element)`
108+
- `com.sap.cds.services.ServiceExceptionUtils.getMessageTarget(String target)``MessageTarget.create(target)`
109+
- `com.sap.cds.services.ServiceExceptionUtils.getMessageTarget(String parameter, Class<E> type, Function<E, Object> path)``MessageTarget.create(parameter, type, path)`
110+
- `com.sap.cds.services.ServiceExceptionUtils.getMessageTarget(String parameter, Function<StructuredType<?>, Object> path)``MessageTarget.create(parameter, path)`
111+
69112
## CAP Java 3.10 to CAP Java 4.0 { #three-to-four }
70113

71114
### New License

0 commit comments

Comments
 (0)