Compare commits
2 Commits
compose-wi
...
temporal
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b629f8faf3 | ||
|
|
9479aa4cad |
@@ -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 {
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user