Stop using sap.ui.model.odata.ODataModel aka V1 ODataModel – it’s deprecated since 2015!
A few days ago I wrote a blog about deprecated SAP GW APIs here in the SAP Gateway Community. If you use the ODataModel in UI5 you have multiple options:
Feel free to choose which one you want to use – NOT!
Don’t use sap.ui.model.odata.ODataModel because it’s deprecated! Yes, that’s correct! That’s why it’s not used in in any of the tutorials! And this information is not new. In fact, it’s deprecated since summer 2015 if I remember right. However, this is not clearly mentioned in the API docs:
From the API docs (see screenshot and/or links above) you would not guess it’s deprecated. However, have a look at SAPUI5 1.30.6 – Instantiating an OData Model and SAPUI5 1.42.8 – OData V2 Model of the Developer Guide:
“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.”
Especially for new apps make sure you use the v2.ODataModel or (if you can) the v4.ODataModel. When I make code reviews I typically reject code/apps using the old ODataModel. In the view of some developers this might look a little harsh… Hmm, what do you think?
UPDATE: The correct year is 2015 and not 2014