Backendless 4 Issue with Data Relation Saving in iOS

I just created a new application using the backendless 4. But I am looking at the data relations in the tables for backendless 3 and 4 and it looks like there is too much overhead in the new system.
Here are the relation details :</img></img>
Here is the ERD</img>
The issue is in the old backendless 3, i just have to add create a new object for the MyOils class and add it in the property of Backendless user object then I just have to call 1 server call and it all gets saved to the server with proper relations. With following code:

MyOils *newOil = [MyOils new];
 newOil.MySingleOil = self.singleOil;

    [allMyOils addObject:newOil];
[updatingUser setProperty:@"MyOils" object:allMyOils];

BackendlessUser *updatingUser = backendless.userService.currentUser;[backendless.userService update:updatingUser response:^(BackendlessUser *updatedUser) {

backendless.userService.currentUser = updatedUser;

} error:^(Fault *error) {}];

But in the Backendless 4 , I have make 4 server calls to get the same effect. With following code:

MyOils *newOil = [MyOils new];
 id&lt;IDataStore&gt; dataStoreMyOils = [ of:[MyOils class]];
 [dataStoreMyOils save:newOil response:^(MyOils* newSavedOil) { 
 [dataStoreMyOils setRelation:@"MySingleOil" parentObjectId:newSavedOil.objectId childObjects:@[self.singleOil.objectId] response:^(NSNumber *number) {
 id&lt;IDataStore&gt;dataStoreUsers = [ ofTable:@"Users"];
 [dataStoreUsers setRelation:@"MyOils" parentObjectId:backendless.userService.currentUser.objectId childObjects:@[newSavedOil.objectId] response:^(NSNumber *num) {
 [backendless.userService findById:backendless.userService.currentUser.objectId response:^(BackendlessUser *latestUser) {
 backendless.userService.currentUser = latestUser;
 } error:^(Fault *error) {}];} error:^(Fault *error) {}];} error:^(Fault *error) {}];} error:^(Fault *error) {}];

My Question is is this all correct?
Do I have to call the server 4 times now to get this working?
Or Am I missing a better way for that?

Hi Umer

Thanks you for your question.

Yes, in 4.x you can not do that in a single request, you can add only exists(stored on the server) objects as relations to another exist object.

So, you can do 4 request:

  1. create/save SingleOil
  2. create/save MyOils
  3. add saved SingleOil to saved MyOils
  4. add saved MyOils to user

Or, I can propose you to use BusinessLogic for it, you can implement it via EventHandlers or APIServices

below you can see links for BL docs,

EventHandlers docs:

APIServices docs:

APIServices video:

Hope it will help you.

Regards, Vlad

Hi Vladimir U

Ok got your point.

Thanks for the quick reply.

Hopefully you guys will be working on this in the future as it seems to be real big overhead for now.