javascript - OData V2 模型上的 Kapsel 离线应用程序的 SAPUI5 深度插入

标签 javascript odata sapui5

问题:

如何从 OData V2 模型上的 SAPUI5 客户端应用程序执行“深度插入”?

情况:

我想将“操作”与一些“组件”一起深度插入到我的 SAPUI5 客户端应用程序中的 OData V2 模型中。

 // the request data
 "OperationSet" : {         
          "Orderid" : "13700090",       
          "OperationComponentSet" : [
              {                
                "Orderid" : "13700090",
                "Activity" : "0010",
                "SubActivity" : "",
                "ComponentItem" : "000010"                 
              }
            ]
}

this.getView().getModel().create("/OperationSet", requestData);

我无法在 OData V2 模型上使用函数 create(sPath, oData, mParameters?),文档显示:“请注意,不支持深度创建,并且可能无法工作。”参见https://sapui5.netweaver.ondemand.com/sdk/docs/api/symbols/sap.ui.model.odata.v2.ODataModel.html#create

是否有其他可能性在 OData V2 模型上执行深度插入?

链接:

最佳答案

答案是,“深度插入”目前不支持与离线 Kapsel 插件的 0..n 关联。

参见http://help.sap.com/saphelp_smp308sdk/helpdata/en/d3/0ded03756247f1a136c84be7901879/content.htm

Limitations of Deep Inserts A deep insert is an OData POST request to create an entity that also contains the inlined definitions of related entities.

When a deep insert is processed, the top-level entity and all of its related entities are created and linked together as a single operation. In SDK SP07, the Offline Store supports deep inserts through the OData API on Android, iOS and WinPhone 8 platforms with one important restriction:

  • The navigation property used for the deep insert must refer to at most one entity. Any inlined related entities must be added using a navigation property whose ToRole refers to an association end with cardinality 0..1 or 1. They cannot be added using a navigation property whose ToRole refers to an association end with cardinality *. Navigation properties that refer to a set of entities cannot be used for deep inserts.

因此,只有当前针对网关在线执行请求时,“深度插入”才会起作用。

关于javascript - OData V2 模型上的 Kapsel 离线应用程序的 SAPUI5 深度插入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31585960/

相关文章:

OData 选择查询在 ASP.NET WebAPI 测试版中不起作用

entity-framework - 如何在 ASP.NET MVC 5 中为同一个 OData Controller 设置多个实体集

http - 了解 OData 服务

javascript - 读取 Javascript 函数参数数据类型信息

javascript - 如何判断视频是否受版权保护? YouTube API v3

c# - Controller Action HttpGet 执行错误的 Action

javascript - React setState 更新值但未显示在 UI 中

javascript - 查明是否在单选按钮组中选择了单选按钮

javascript - 带有 SensorTag CC2650 的 Web 应用程序

javascript - 在自定义事件上允许 "Find Usages"的 IDE?