on 09-06-2022 12:13 PM
Dear experts,
we are using @sap/cds-odata-v2-adapter-proxy in our service and when querying a single composition-entry, we get back all of them.
The schema.cds of our BusinessPartnersService looks roughly like this.
project/businesspartner/db/schema.cds:
using {
common.Addresses
} from '@common';
entity BusinessPartners : managed, cuid {
someProperties : String;
addresses : Composition of many Addresses
on addresses.parent = $self.ID;
}
We explicitly expose the Addresses in the service.cds since we want to allow updates on them.
project/businesspartner/srv/businesspartners-service.cds:
using {common.Addresses} from '@common';
service BusinessPartnersService {
entity BusinessPartners as projection on my.BusinessPartners
entity common.Addresses as projection on Addresses;
}
The schema for the addresses is imported from our common package. It basically looks like this.
project/common/db/schema.cds:
namespace common;
@cds.persistence.skip : 'if-unused'
entity Addresses : managed, cuid {
parent : UUID;
someAddressProperties : String;
}
If we now start the service locally and try to query a single address directly via
http://localhost:4004/v2/business-partners/common_Addresses(guid'<guid-of-the-address>')
the service responds with the list of all addresses, the same result when querying
http://localhost:4005/v2/business-partners/common_Addresses.
The same result occurs for other syntax, such as
Strangely, the v4 service behaves as expected. We get the specified single entry with
http://localhost:4005/business-partners/common_Addresses(guid'<guid-of-the-address>').
Do you have an idea why we can not access single address entries like this ?
Thank you very much in advance
Christoph
Hi Christoph,
Have you tried with .../common_Addresses?$filter=id eq '<guid-of-the-address>'
Thanks,
Sudhi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
11 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.