Skip to content

Commit ccfec6c

Browse files
authored
Simplify notes mashup model (#470)
1 parent 01ce2dd commit ccfec6c

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

srv/notes-mashup.cds

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,16 @@ using { API_BUSINESS_PARTNER } from './external/API_BUSINESS_PARTNER';
33
/**
44
* Simplified view on external addresses, which is used as an association target in Notes.
55
*/
6-
entity my.bookshop.NoteableAddresses as select from API_BUSINESS_PARTNER.A_BusinessPartnerAddress mixin {
7-
// bi-directional association
8-
notes : Composition of many bookshop.Notes on notes.address.businessPartner = $projection.businessPartner and notes.address.ID = $projection.ID
9-
} into {
6+
entity my.bookshop.NoteableAddresses as projection on API_BUSINESS_PARTNER.A_BusinessPartnerAddress {
107
key AddressID as ID,
118
key BusinessPartner as businessPartner,
129
@readonly Country as country,
1310
@readonly CityName as city,
1411
@readonly PostalCode as postalCode,
1512
@readonly StreetName as street,
1613
@readonly HouseNumber as houseNumber,
17-
notes @(odata.contained: false)
14+
@odata.contained: false notes : Composition of many bookshop.Notes
15+
on notes.address.businessPartner = $self.businessPartner and notes.address.ID = $self.ID
1816
};
1917

2018
/*

srv/src/main/java/my/bookshop/handlers/AdminServiceHandler.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import com.sap.cds.services.ErrorStatuses;
3030
import com.sap.cds.services.EventContext;
3131
import com.sap.cds.services.ServiceException;
32-
import com.sap.cds.services.cds.CdsReadEventContext;
3332
import com.sap.cds.services.cds.CdsUpdateEventContext;
3433
import com.sap.cds.services.cds.CqnService;
3534
import com.sap.cds.services.draft.DraftCancelEventContext;

0 commit comments

Comments
 (0)