gpt4 book ai didi

s4sdk - 无法使用s4sdk对Odata服务执行删除操作

转载 作者:行者123 更新时间:2023-12-02 00:55:04 26 4
gpt4 key购买 nike

我关注了博客,我能够在我的自定义 OData 服务上执行创建、读取和更新操作,但我找不到任何博客/文档来进行删除操作。请帮忙。

最佳答案

没有关于在自定义 OData 服务上执行删除操作的专门博客文章,但我们建议您遵循以下模式:

public class DeleteAddressCommand extends ErpCommand<Integer> {
private static final Logger logger = CloudLoggerFactory.getLogger(DeleteAddressCommand.class);

private final BusinessPartnerService service;
private final String businessPartnerId;
private final String addressId;

public DeleteAddressCommand(final BusinessPartnerService service,
final String businessPartnerId, final String addressId) {
super(HystrixUtil.getDefaultErpCommandSetter(
DeleteAddressCommand.class,
HystrixUtil.getDefaultErpCommandProperties().withExecutionTimeoutInMilliseconds(10000)));

this.service = service;
this.businessPartnerId = businessPartnerId;
this.addressId = addressId;
}

@Override
protected Integer run() throws Exception {
final BusinessPartnerAddress addressToDelete = BusinessPartnerAddress.builder()
.businessPartner(businessPartnerId)
.addressID(addressId)
.build();

final ODataDeleteResult oDataDeleteResult = service
.deleteBusinessPartnerAddress(addressToDelete)
.execute();

return oDataDeleteResult.getHttpStatusCode();
}
}

我粘贴了 this official example 中的代码

最美好的祝愿弗洛里安

关于s4sdk - 无法使用s4sdk对Odata服务执行删除操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54925311/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com