Files
cloud-cap-samples/packages/bookshop/db/schema.cds
2020-03-21 23:31:43 +01:00

41 lines
950 B
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

namespace sap.capire.bookshop;
using { Currency, managed } from '@sap/cds/common';
entity Books : managed, additionalInfo {
key ID : Integer;
title : localized String(111);
descr : localized String(1111);
author : Association to Authors;
stock : Integer;
price : Decimal(9,2);
currency : Currency;
}
entity Authors : managed {
key ID : Integer;
name : String(111);
books : Association to many Books on books.author = $self;
}
entity Orders : managed {
key ID : UUID;
OrderNo : String @title:'Order Number'; //> readable key
Items : Composition of many OrderItems on Items.parent = $self;
}
entity OrderItems {
key ID : UUID;
parent : Association to Orders;
book : Association to Books;
amount : Integer;
}
entity Movies: additionalInfo {
key ID : Integer;
name : String(111);
}
aspect additionalInfo{
genre: String(100);
language: String(200);
}