diff --git a/.env b/.env index 01ade12c..ea6488f9 100644 --- a/.env +++ b/.env @@ -1 +1,8 @@ -cds.features.snapi = y \ No newline at end of file +cds.features.snapi = true +cds.odata.version = v4 +cds.odata.containment = true +cds.odata.proxies = true +cds.odata.format = structured +cds.cdsc.beta.uniqueconstraints = true +cds.cdsc.beta.aspectCompositions = true +cds.cdsc.severities.unexpected-key = info diff --git a/recap/assoc-paths-w-filters.cds b/recap/assoc-paths-w-filters.cds new file mode 100644 index 00000000..f9899571 --- /dev/null +++ b/recap/assoc-paths-w-filters.cds @@ -0,0 +1,5 @@ +using { sap.capire.bookshop.Authors } from '@capire/bookshop'; + +define view Foo as select from Authors { + ID, name, books[where title like 'Cat%'].currency.code +}; diff --git a/recap/extend-w-named-aspects.cds b/recap/extend-w-named-aspects.cds new file mode 100644 index 00000000..309ec396 --- /dev/null +++ b/recap/extend-w-named-aspects.cds @@ -0,0 +1,27 @@ +using { User, cuid, managed } from '@sap/cds/common'; + +// Looks like inheritance, but isn't +entity Foo @bar : cuid, managed { bar:Car; } + +// It's just syntactical sugar for Aspects +entity Boo {} +extend Boo with cuid; +extend Boo with managed; +extend Boo with { bar:Car; } +annotate Boo with @bar; + +// There's close to no limits +entity Moo : Foo {} +entity Zoo {}; extend Zoo with Foo; + +// This one will apply to all uses above +type Car : String; +annotate Car with @car; + +// And these to all uses here and wherever else +extend managed with { + notes : String; +} + +// CDS is built with CDS +annotate cds.UUID with @odata.Type: 'Edm.Integer'; diff --git a/recap/extending-views.cds b/recap/extending-views.cds new file mode 100644 index 00000000..b0f5a8dd --- /dev/null +++ b/recap/extending-views.cds @@ -0,0 +1,10 @@ +using { CatalogService } from '@capire/bookshop'; + +extend sap.capire.bookshop.Books with { + ISBN : String; +} + +/** your docs go here */ +extend projection CatalogService.Books with { + ISBN +}