Description
CDS compiler v7 (CDS 10) simplifies the key propagation algorithm for views and projections. Previously, keys were propagated from a base entity to a view under specific conditions that could result in views unexpectedly lacking keys or having them in some configurations but not others. The new algorithm is more consistent but may cause views that previously had no keys to now inherit keys from their base entity. Application code, OData metadata, and database deployment artifacts that assumed a specific key structure on views may behave differently after the upgrade.
How to Check
[ ] No automated detection is possible — run integration tests to surface regressions.
[ ] Compile the data model with both CDS 9 and CDS 10, then diff the resulting CSN to identify views where key propagation changed:
sh# With CDS 9 cds compile srv/ --to csn > csn-v9.json # After upgrading to CDS 10 cds compile srv/ --to csn > csn-v10.json diff csn-v9.json csn-v10.json[ ] In the diff, look for
"key": trueappearing on elements that did not have it before, or disappearing where it was present.[ ] Check OData metadata (
$metadataendpoint) for key changes on entity types exposed by services — new keys will appear in theEntityTypedefinition.[ ] Check database deployment artifacts (
gen/db/) for index or primary key changes.
Migration Steps
Run the CSN diff as described above to identify affected views and projections.
For views that unexpectedly gained keys and where that causes problems, explicitly exclude the key element from the projection or declare it as a non-key element:
diff// If a key was unexpectedly propagated and is unwanted: entity BooksView as projection on Books { - * + Books.title, + Books.stock, + Books.author // omit key ID to prevent propagation — or keep and adapt consumers };For views that lost keys where they were previously present, explicitly mark the identifying element as a key in the projection:
diffentity BooksView as projection on Books { + key Books.ID, Books.title, Books.stock };Update OData client code, UI5 bindings, and integration tests that depend on the specific key structure of affected views.
Notes
No automated detection is possible for this change — it requires comparing compiled CSN output between versions. The impact is highest for applications that expose views via OData services and have UI5 components or API clients that rely on key navigation. Run the full integration test suite after upgrading and inspect any failures related to entity identity, navigation, or delta queries.