1

I am trying to create an entity following the step 20 in the SDK Tutorials. But when I build the project with the command mvn clean install

I added the following imports that are available in https://help.sap.com/http.svc/rc/05fbf11f8ccc403dba4f90150e8f4ccf/1.0/en-US/index.html?com/sap/cloud/sdk/s4hana/datamodel/odata/namespaces/package-summary.html

import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.businesspartner.AddressEmailAddress;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.businesspartner.BusinessPartnerAddress;
import com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.businesspartner.BusinessPartnerRole;

I see the following error.

[ERROR] /C:/Users/sanke/workspace/Businesspartners_cloudfoundry/application/src/main/java/com/yash/cf/Businesspartners_cloudfoundry/BusinessPartnerServlet.java:[81,17] toEmailAddress(java.util.List) has private access in com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.businesspartner.BusinessPartnerAddress.BusinessPartnerAddressBuilder [ERROR] /C:/Users/sanke/workspace/Businesspartners_cloudfoundry/application/src/main/java/com/yash/cf/Businesspartners_cloudfoundry/BusinessPartnerServlet.java:[93,17] toBusinessPartnerAddress(java.util.List) has private access in com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.businesspartner.BusinessPartner.BusinessPartnerBuilder [ERROR] /C:/Users/sanke/workspace/Businesspartners_cloudfoundry/application/src/main/java/com/yash/cf/Businesspartners_cloudfoundry/BusinessPartnerServlet.java:[94,17] toBusinessPartnerRole(java.util.List) has private access in com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.businesspartner.BusinessPartner.BusinessPartnerBuilder

Sankeerth
  • 249
  • 3
  • 12

1 Answers1

0

The blog still refers to version 1.5.0. The error you have indicates that you are using a more recent version >= 1.6.0 where the signature of navigation properties has changed slightly. For example, instead of toEmailAddress(List<AddressEmailAddress> value) the methods have been reworked to emailAddress(AddressEmailAddress... value). Please also consult the release notes for 1.6.0 on this matter.

Therefore, please change your code to the following:

final BusinessPartnerAddress businessPartnerAddress = BusinessPartnerAddress.builder()
    .country(country)
    .cityName(city)
    .emailAddress(emailAddress)
    .build();

The tutorial has been updated as well.

Philipp Herzig
  • 350
  • 6
  • 10