Compare commits

...

2 Commits

Author SHA1 Message Date
Daniel
b629f8faf3 Merge branch 'master' into temporal 2021-04-10 13:08:31 +02:00
Daniel
9479aa4cad . 2021-04-08 19:17:48 +02:00
3 changed files with 25 additions and 2 deletions

1
.env Normal file
View File

@@ -0,0 +1 @@
# cdsc

View File

@@ -1,4 +1,4 @@
using { Currency, managed, sap } from '@sap/cds/common'; using { Currency, managed, temporal, sap } from '@sap/cds/common';
namespace sap.capire.bookshop; namespace sap.capire.bookshop;
entity Books : managed { entity Books : managed {

View File

@@ -1,5 +1,27 @@
using { sap.capire.bookshop as my } from '../db/schema'; using { sap.capire.bookshop as my } from '../db/schema';
service AdminService @(requires:'admin') { service AdminService @(requires:'admin') {
entity Books as projection on my.Books;
entity Books as SELECT from my.Books { *,
// key ID, key validFrom
};
entity Authors as projection on my.Authors; entity Authors as projection on my.Authors;
// @cds.redirection.target:false
// entity Books.history @(cds.temporal:false) as projection on Books {
// *,
// key ID,
// key validFrom @(cds.valid.from:false),
// validTo @(cds.valid.to:false),
// };
}
// entity NonTemporalBook as projection on my.Books {
// *,
// key ID,
// key validFrom @(cds.valid.from:false),
// validTo @(cds.valid.to:false),
// };
extend my.Books with {
history : Composition of many my.Books on history.ID = $self.ID;
} }