sapmentors / cap-community

SAP CAP Community
MIT License
97 stars 26 forks source link

$expand for entity from remote service doesn't trigger READ event #115

Open EvgenBaranau opened 2 years ago

EvgenBaranau commented 2 years ago

Hello team.

Faced on issue, but I am not sure about expected behaviour. I have the data model:

entity A {
    key Id: Integer;
    Subject : String;
    LinkToB: Association to B ;
}

service Service  {
    entity A as projection on A;

    entity B as projection on B;
}

B is entity from remote service. And the idea is to fetch B from remote service once user wants to expand LinkToB. For that, I should handle READ event for entity B, but this event doesn't trigger, framework tries to find the table B in database. Is it expected behaviour?

In other words, I wait 2 READ events when user call GET Service/A?$expand=LinkToB : READ for entity B, and READ for entity A.

In case, when only one event is expected, how to salve this issue?

vobu commented 2 years ago

I'd suggest to post this on https://answers.sap.com/tags/9f13aee1-834c-4105-8e43-ee442775e5ce for wider reach