Skip to content

Commit

Permalink
Make CDS sample more explicit (#253)
Browse files Browse the repository at this point in the history
The fact that `using { my.bookshop } from '../db/index';` created an
implicit alias `bookshop` for the `my.bookshop` package, which is then
even used to refer to `my.bookshop.Addresses` as `bookshop.Addresses`
(although not even defined in `../db/index`) is not so easy to grasp.

The sample is now more explicit by referring to `my.bookshop.Addresses`
and only importing `Orders` from `../db/index`
  • Loading branch information
beckermarc authored Oct 9, 2023
1 parent 7012e70 commit 80991ea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions srv/external.cds
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ entity my.bookshop.Addresses as projection on external.A_BusinessPartnerAddress
/*
* Extend Orders with references to replicated external Addresses
*/
using { my.bookshop } from '../db/index';
extend bookshop.Orders with {
shippingAddress : Association to bookshop.Addresses;
using { my.bookshop.Orders } from '../db/index';
extend Orders with {
shippingAddress : Association to my.bookshop.Addresses;
}

0 comments on commit 80991ea

Please sign in to comment.