While some of the differences between the OData V4 model and the OData V2 model are due to features that have not yet been implemented, many differences are due to the following:
Protocol incompatibility between OData V4 and OData V2
API cleanup and simplification
Adherence to OData V4 standards regarding the names and terms used in APIs
These differences will therefore remain even after all features have been implemented. The table below gives you an overview of these changes, as well as the reason behind them and (if applicable) how the OData V2 model mechanism is supported in the OData V4 model.
Change |
Reason |
---|---|
Binding parameter names: The binding parameter name for an OData system query option is
identical to the system query option name: |
Simplification: The OData V4 model simplifies the binding parameter structure to just one map where all entries in the map are OData query options, with the exception of entries that have a key starting with "$$" (binding-specific parameters). In all cases, the names of the binding parameters are exactly the same as in the OData URL sent to the server. |
The model does not support the methods |
OData requires asynchronous data retrieval: Synchronous data access requires that data has already been loaded from the server. This means there is no way of knowing whether this already happened, meaning the result of a synchronous access method is quite often unpredictable. The OData V4 context API offers ansynchronous and synchronous access to the data of a specific context. It is no longer necessary to construct a path for data access as needed by the methods on the model. For more information, see the section Context API in Bindings. |
Minimize APIs required for batch control: Model does not support the methods
|
Simplification: Batch groups are solely defined via binding parameters with the
corresponding parameters on the model as default. Application groups
are by default deferred; there is no need to set or get deferred
groups. You just need the |
OData operations executed via binding: Model does not support the method
|
Simplification: Use an operation binding instead; it is now much easier to bind operation execution results to controls. |
No CRUD methods on model: Model does not support the methods |
Simplification: |
No metadata access via model: Model does not support methods
|
Simplification: Metadata is only accessed via |
sap.ui.model.odata.AnnotationHelper is not supported for OData V4. |
Simplification: Much of the functionality in sap.ui.model.odata.AnnotationHelper is provided by sap.ui.model.odata.v4.ODataMetaModel and sap.ui.model.odata.v4.ODataModel. You can find the remaining functionality in the OData V4 specific sap.ui.model.odata.v4.AnnotationHelper. The path syntax supported by the v4.ODataMetaModel, see sap.ui.model.odata.v4.ODataMetaModel, method |
The property binding automatically determines the appropriate type depending on the property's metadata, unless a type is specified explicitly. | For more information, see Type Determination.
By default, a property binding delivers a value formatted according to the target type of the control property it applies to, for
example <Icon src="sap-icon://message-warning" visible="{ path: 'DeliveryDate', targetType: 'any', formatter: '.isOverdue' }"/> The above also applies to Expression Bindings. In this case, there is a
convenience notation
A property binding can have an object value. For more information, see Property Binding With an Object Value: <SimpleForm binding="{/BusinessPartnerList('42')}"> <Label text="Phone number list"/> <Text text="{ path: 'BP_2_CONTACT', mode: 'OneTime', targetType: 'any', formatter: '.formatPhoneNumbersAsCSV' }"/> </SimpleForm> |