Mark here’s my Foo class that recreates my question. Also attached is a screenshot of the uploaded data. Notice that Backendless changed my field names by stripping out “is”. And note the “null” entries even though all of the data was explicitly set.
public class Foo {
private boolean isFunny1;
private boolean isFunny2;
private boolean isFunny3;
private boolean isFunny4;
private boolean isFunny5;
private boolean isFunny6;
public Foo() {
// A default constructor is required.
}
//region Getters and Setters
public boolean isFunny1() {
return isFunny1;
}
public void setIsFunny1(boolean isFunny1) {
this.isFunny1 = isFunny1;
}
public boolean isFunny2() {
return isFunny2;
}
public void setIsFunny2(boolean isFunny2) {
this.isFunny2 = isFunny2;
}
public boolean isFunny3() {
return isFunny3;
}
public void setIsFunny3(boolean isFunny3) {
this.isFunny3 = isFunny3;
}
public boolean isFunny4() {
return isFunny4;
}
public void setIsFunny4(boolean isFunny4) {
this.isFunny4 = isFunny4;
}
public boolean isFunny5() {
return isFunny5;
}
public void setIsFunny5(boolean isFunny5) {
this.isFunny5 = isFunny5;
}
public boolean isFunny6() {
return isFunny6;
}
public void setIsFunny6(boolean isFunny6) {
this.isFunny6 = isFunny6;
}
//endregion
public static Foo newInstance(boolean funny1, boolean funny2, boolean funny3,
boolean funny4, boolean funny5, boolean funny6) {
Foo newFoo = new Foo();
newFoo.setIsFunny1(funny1);
newFoo.setIsFunny2(funny2);
newFoo.setIsFunny3(funny3);
newFoo.setIsFunny4(funny4);
newFoo.setIsFunny5(funny5);
newFoo.setIsFunny6(funny6);
return newFoo;
}
public static void saveAsync(final Foo foo) {
// save object asynchronously
Backendless.Persistence.save(foo, new AsyncCallback<Foo>() {
public void handleResponse(Foo response) {
// new Contact instance has been saved
}
public void handleFault(BackendlessFault fault) {
// an error has occurred, the error code can be retrieved with fault.
}
});
}
public static void saveFooObjects() {
ArrayList<Foo> fooArrayList = new ArrayList<>();
Foo foo = newInstance(false, false, false, false, false, false);
fooArrayList.add(foo);
foo = newInstance(false, true, false, false, false, false);
fooArrayList.add(foo);
foo = newInstance(false, false, true, false, false, false);
fooArrayList.add(foo);
foo = newInstance(false, false, false, true, false, false);
fooArrayList.add(foo);
foo = newInstance(false, false, false, false, true, false);
fooArrayList.add(foo);
foo = newInstance(true, true, true, true, true, true);
fooArrayList.add(foo);
for (Foo fooObject : fooArrayList) {
saveAsync(fooObject);
}
}
}