These are examples for CRUD OPerations
var oModel = this.getView().getModel();
Create Operation
==============================
var oPayload = {
"name":"name";
};
oModel.create("/SampleSet", oPayload, {
method: "POST",
success: function (oData, oResponse) {
},
error: function (error, resp) {
}
});
Update Operation
==============================
var oPayload = {
"name":"name";
};
var sPath = "/SampleSet(SampleNumber='
oModel.update(sPath, oPayload{
method: "PUT",
success: function () {
},
error: function (oError) {
}
});
Read operation
==============================
var oName = "Raj"
var aFilter = [
new sap.ui.model.filter({"Name","
oModel.read("/sampleSet", {
filters: aFilter,
success: function (oData) {
},
error: function (oError) {
}
});
Delete Operation
==============================
var sPath = "/SampleSet(SampleNumber='
oModel.remove(sPath, {
success: function () {
},
error: function (oError) {
}
});
Read operation
==============================
var oName = "Raj"
var aFilter = [
new sap.ui.model.filter({"Name","
oModel.read("/sampleSet", {
filters: aFilter,
success: function (oData) {
},
error: function (oError) {
}
});
Delete Operation
==============================
var sPath = "/SampleSet(SampleNumber='
oModel.remove(sPath, {
success: function () {
},
error: function (oError) {
}
});