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: