Compare commits

...

2 Commits

Author SHA1 Message Date
Daniel
98577c1ecc re cap 2020-05-15 09:00:56 +02:00
Daniel
e8cd0e3231 Samples for re:cap 2020-05-15 08:37:40 +02:00
5 changed files with 58 additions and 1 deletions

9
.env
View File

@@ -1 +1,8 @@
cds.features.snapi = y
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

8
orders/.env Normal file
View File

@@ -0,0 +1,8 @@
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

View File

@@ -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
};

View File

@@ -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';

10
recap/extending-views.cds Normal file
View File

@@ -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
}