Hey guys,
I have two model objects, Party and Recipe. Party contains a List of Recipe objects:
public class Party extends ModelObject {
private String ownerId; private String objectId;
private Long created;
private Long updated; private List<Recipe> menuItems = new ArrayList<>();
}
public class Recipe extends ModelObject {
private String ownerId; private String objectId;
private Long created;
private Long updated; private String recipeName;
}
And here is my save call:
Backendless.Persistence.of(Party.class).save(party, new AsyncCallback<Party>() {
@Override
public void handleResponse(Party party) {
PartyPlannerLog.v(TAG, "Party Saved");
}
@Override
public void handleFault(BackendlessFault fault) {
PartyPlannerLog.v(TAG, "Party not Saved");
}
});
When I make this call, all non-List properties update properly, whether I update a String or boolean, doesn’t matter, it works. But when it comes to the List of Recipe objects in the Party table, I can only add to this list. I can’t remove.
The way I get my Party is as follows:
final protected BackendlessDataQuery dataQuery = new BackendlessDataQuery();dataQuery.setPageSize(100);Backendless.Persistence.of(Party.class).find(dataQuery,
new AsyncCallback<BackendlessCollection<Party>>() {
@Override
public void handleResponse(BackendlessCollection<Party> response) {
//Get list here
PartyPlannerLog.v(TAG, "Getting Party success");
}
@Override
public void handleFault(BackendlessFault fault) {
PartyPlannerLog.v(TAG, "Fail getting Party");
}
});
From that list, I get the Party I need, modify the List of Recipe objects, then make the save call, but again, I can only add to the list, not remove items.
Please advise!
Thanks!