-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.cds
41 lines (36 loc) · 922 Bytes
/
schema.cds
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
namespace sap.capire.bookshop;
using {
Currency,
managed
} from '@sap/cds/common';
entity Books : managed {
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',
description: 'Description'
);
Items : Composition of many OrderItems
on Items.parent = $self;
}
entity OrderItems {
key ID : UUID;
parent : Association to one Orders;
book : Association to one Books;
amount : Integer;
}