From 9863c76a47e59fc1bfeb2b7bac21b724f8de91d1 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Wed, 5 Jul 2023 17:28:13 +0200 Subject: [PATCH] Update cp-cap-java-service-reuse.md --- .../cp-cap-java-service-reuse.md | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/tutorials/cp-cap-java-service-reuse/cp-cap-java-service-reuse.md b/tutorials/cp-cap-java-service-reuse/cp-cap-java-service-reuse.md index df54ebd461..d1bab1706d 100644 --- a/tutorials/cp-cap-java-service-reuse/cp-cap-java-service-reuse.md +++ b/tutorials/cp-cap-java-service-reuse/cp-cap-java-service-reuse.md @@ -106,35 +106,32 @@ Now that you have created your bookstore project, you need to define the domain ```CDS namespace sap.capire.bookstore; - + using { Currency, cuid, managed } from '@sap/cds/common'; using { sap.capire.products.Products } from '@sap/capire-products'; - + entity Books as projection on Products; extend Products with { // Note: we map Books to Products to allow reusing AdminService as is author : Association to Authors; } - + entity Authors : cuid { firstname : String(111); lastname : String(111); books : Association to many Books on books.author = $self; } - + @Capabilities.Updatable: false entity Orders : cuid, managed { - items : Composition of many OrderItems on items.parent = $self; + items : Composition of many { + book_ID : UUID; + amount : Integer; + netAmount : Decimal(9,2) @readonly; + }; total : Decimal(9,2) @readonly; currency : Currency; } - @Capabilities.Updatable: false - entity OrderItems : cuid { - parent : Association to Orders not null; - book_ID : UUID; - amount : Integer; - netAmount : Decimal(9,2) @readonly; - } ``` The domain model defines four entities: