简体   繁体   English

从 Kapsel 离线应用程序在 OData V2 模型上进行 SAPUI5 深度插入

[英]SAPUI5 Deep Insert from Kapsel Offline App on OData V2 Model

Question:题:

How can a "Deep Insert" performed from a SAPUI5 Client application on an OData V2 Model?如何从 SAPUI5 客户端应用程序在 OData V2 模型上执行“深度插入”?

Situation:情况:

I want to Deep Insert an "Operation" together with some "Components" into my OData V2 Model in my SAPUI5 Client application.我想在我的 SAPUI5 客户端应用程序中将“操作”和一些“组件”深入插入到我的 OData V2 模型中。

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

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

I cannot use the function create(sPath, oData, mParameters?) on the OData V2 Model the documentation says: "Please note that deep creates are not supported and may not work."我不能在 OData V2 模型上使用函数create(sPath, oData, mParameters?)文档说:“请注意,深度创建不受支持并且可能不起作用。” see https://sapui5.netweaver.ondemand.com/sdk/docs/api/symbols/sap.ui.model.odata.v2.ODataModel.html#createhttps://sapui5.netweaver.ondemand.com/sdk/docs/api/symbols/sap.ui.model.odata.v2.ODataModel.html#create

Is there any other possibility to perform a Deep Insert on an OData V2 Model?是否还有其他可能在 OData V2 模型上执行深度插入?

Links:链接:

The answer is, "Deep Insert" doesn't support 0..n assoziations with the Offline Kapsel Plugin at the moment.答案是,“深度插入”目前不支持与离线 Kapsel 插件的 0..n 关联。

see http://help.sap.com/saphelp_smp308sdk/helpdata/en/d3/0ded03756247f1a136c84be7901879/content.htmhttp://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.深度插入的限制 深度插入是一个 OData POST 请求,用于创建一个实体,该实体还包含相关实体的内联定义。

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:在 SDK SP07 中,离线商店支持在 Android、iOS 和 WinPhone 8 平台上通过 OData API 进行深度插入,但有一个重要限制:

  • 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 *.必须使用其 ToRole 指代基数为 0..1 或 1 的关联结束的导航属性添加任何内联相关实体。不能使用其 ToRole 指代基数为 * 的关联结束的导航属性添加它们。 Navigation properties that refer to a set of entities cannot be used for deep inserts.引用一组实体的导航属性不能用于深度插入。

So "Deep Insert" will only work if the request is executed online against the gateway at the moment.因此,“深度插入”仅在当前针对网关在线执行请求时才有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM