SAP OData 的 V2 模型
文档地址:
https://sapui5.hana.ondemand.com/#/topic/6c47b2b39db9404582994070ec3d57a2#loio66a130fa4d10411b8fc90df00185554b
The OData model is a server-side model, meaning that the data set is only available on the server and the client only knows the currently visible (requested) data. Operations, such as sorting and filtering, are done on the server. The client sends a request to the server and shows the returned data.
OData 模型是一个服务器端模型,这意味着业务数据只在服务器端可用,客户端只维护了其当前发出请求后,服务器端返回的部分数据。围绕数据进行的排序和过滤等操作,都是先在服务器端执行,再将执行结果返回给客户端。
Requests to the back end are triggered by list bindings (ODataListBinding), context bindings (ODataContextBinding), and CRUD functions provided by the ODataModel. Property bindings (ODataPropertyBindings) do not trigger requests.
目前 OData 模型通过如下 API 触发向后台的数据请求:
- List binding - ODataListBinding
- context binding - ODataContextBinding
- 增删改查操作
The following two versions of the OData model are implemented:
- sap.ui.model.odata.ODataModel
- sap.ui.model.odata.v2.ODataModel.
The v2.ODataModel has an improved feature set and new features will only be implemented in this model.
sap.ui.model.odata.ODataModel is deprecated. We recommend to only use v2.ODataModel.
前者已经被标注成 deprecated 状态,后者是 SAP 推荐使用的数据模型。
注意:OData V2 模型已经支持客户端的排序和过滤了。
OData model 模型实例的创建方法:
var oModel = new ODataModel("http://services.odata.org/Northwind/Northwind.svc/");
var oModel = new ODataModel({serviceUrl: "http://services.odata.org/Northwind/Northwind.svc"});
当模型实例创建时,自动触发获取 OData 服务元数据的请求:
http://services.odata.org/Northwind/Northwind.svc/$metadata
Only the first model instance triggers a $metadata request. A JSON representation of the service metadata can be accessed by calling the getServiceMetadata() method on an OData model instance.
JSON 格式的服务元数据,通过模型实例的 getServiceMetadata 方法返回。
var oMetadata = oModel.getServiceMetadata();
In the v2.ODataModel, the service metadata is loaded asynchronously. It is not possible to load it synchronously. To get notified when the loading is finished, attach the metadataLoaded event.
对于 2.0 版本的 OData 模型来说,服务元数据采取一部方式加载,如果在应用程序里想捕捉元数据加载成功的事件,需要监听 metadataLoaded 事件。
相关文章
- SAP UI5 sap.ui.core.Element 的概要介绍
- SAP_FICO常用BAPI
- 使用 SAP UI5 sap.ui.export.Spreadsheet API 进行 Excel 导出的一些限制
- SAP UI5 OData 模型(V2) 的使用方法介绍
- 为什么SAP ECC系统需要升级?升级路径有哪些?
- 什么是 SAP ABAP 的 include structure
- 使用 SAP UI5 3D Viewer 控件显示 3D 模型效果试读版
- SAP QM QS21创建检验特性,报错 - No selected set is assigned to the class characteristic -
- SAP UI5 里一个功能的 compatibility version 是什么含义?
- SAP UI5 sap.m.Table Manual Pop-In Mode 概述
- SAP UI5 响应式表格 sap.m.Table 根据不同宽度的屏幕动态决定显示或隐藏 Column 的实现源代码讲解试读版
- SAP UI5 里响应式表格的 minScreenWidth 属性讲解
- SSH远程重启Tomcat时无法找到JAVA_HOME也连接不上SAP详解编程语言
- SAP S/4 HANA新变化-主数据:物料主数据详解编程语言
- SAP 供应商寄售业务的标准流程详解编程语言
- SAP-MM 价格条件详解-01计算方案的确定及部分概念说明编程语言
- SAP 记账凭证 更改 冲销详解编程语言
- SAP ABAP Debug 小技巧详解编程语言
- 比较:Oracle与SAP的对比(oracle和sap)
- SAP在Linux下的完美适配——利用SAP优势迎接业务发展新时代(saplinux)
- 对比:Oracle 与 SAP的优势(oracle 与 sap)
- Oracle和SAP技术比较优势和劣势(oracle与sap比照)
- Oracle与SAP的技术潜力比较(oracle sap比较)
- OracleSAP云融合突破IT发展新边界(oracle sap 云)