The standard flush/Refresh offline oData functions are performed on all entities in the offline Store.
This, of course, has implications on mobile data and performance.
Is there a way to FLUSH/REFRESH only specific entities in the offline store?
The standard flush/Refresh offline oData functions are performed on all entities in the offline Store.
This, of course, has implications on mobile data and performance.
Is there a way to FLUSH/REFRESH only specific entities in the offline store?
You can write the entity you want to refresh or flush in the third parameter of the methods as an array of strings where each string is the name you put to each "entitySet" on the definingRequests object.
Imagine you defined this on the creation of the store:
"definingRequests" : {
"foo" : "/fooSet",
"bar" : "/barSet"
}
Then, if you only want to refresh the foo entity, the refresh method will be like this:
store.refresh(refreshCallback, errorCallback, ["foo"], progressCallback);
For Offline OData using iOS SDK, there is a withSubset
parameter for the download
command. Using this, you can add a filter to your defining query and thus only download specific entries.
Documentation: https://help.sap.com/doc/978e4f6c968c4cc5a30f9d324aa4b1d7/2.1/en-US/Documents/Frameworks/SAPOfflineOData/Extensions/DataService.html
According to the documentation of the refresh method:
Refresh the model.
This will reload all data stored in the model. This will check all bindings for updated data and update the controls if data has been changed.
Note: In contrast to an individual Binding refresh, the model refresh ignores Binding-specific parameters/queries.
If you want to get only specific entries in the model, you should be looking at the method invalidateEntry
:
Invalidate a single entry in the model data.
Mark the selected entry in the model cache as invalid. Next time a context binding or list binding is done, the entry will be detected as invalid and will be refreshed from the server.