Currently I have NDevice object with fields. One of them is digit_it.
After every new creation of NDevice and saving to the backend it creates additional fields: digitId and notEmpty
Please look at the screenshot.
I have no any place in my code where I’m change this field name or add notEmpty.
How to prevent creation of unknown fields?
protected Integer updateDevices(final BackendlessUser user) {
List<NDevice> devices = new ArrayList<>();
.........
for (NDevice device : devices)
if (TextUtils.isEmpty(device.getObjectId())) {
NDevice savedDevice = Backendless.Persistence.of(NDevice.class).save(device);
}
Integer result = null;
if (ListUtil.isNotEmpty(devices))
result = Backendless.Persistence.of(BackendlessUser.class).setRelation(user, Consts.DEVICES, devices);
return result;
}
public class NDevice implements Serializable {
public String android_id;
public String gcm_token;
public String model;
public String digit_id;
private String objectId;
private java.util.Date created;
private java.util.Date updated;
public String androidId() {
return android_id;
}
public void setAndroId(String androidId) {
this.android_id = androidId;
}
public String gcmToken() {
return gcm_token;
}
public void setGcmToken(String gcmToken) {
this.gcm_token = gcmToken;
}
public String model() {
return model;
}
public void setModel(String model) {
this.model = model;
}
public long digitId() {
long digitId = 0;
if (!TextUtils.isEmpty(digit_id)) {
try {
digitId = Long.parseLong(digit_id);
} catch (Throwable throwable){
throwable.printStackTrace();
}
}
return digitId;
}
public String getDigitId() {
return digit_id;
}
public void setDigitId(long digitId) {
if (digitId != Consts.NONE_LONG)
this.digit_id = String.valueOf(digitId);
}
/**
* Methods
*/
public NDevice create() {
android_id = TechUtil.getAndroidId();
model = TechUtil.getDeviceModel();
return this;
}
public boolean isNotEmpty() {
boolean isNotEmpty = gcm_token != null && android_id != null && digit_id != null;
return isNotEmpty;
}
public static NDevice update(NDevice device) {
device.setAndroId(NUser.i().device().androidId());
device.setGcmToken(NUser.i().device().gcmToken());
device.setModel(NUser.i().device().model());
device.setDigitId(NUser.i().device().digitId());
return device;
}
@Override
public int hashCode() {
return 31 * android_id.hashCode();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null || !(obj instanceof NDevice))
return false;
NDevice device = (NDevice) obj;
return android_id.equalsIgnoreCase(device.android_id);
}
public String getAndroid_id() {
return android_id;
}
public void setAndroid_id(String android_id) {
this.android_id = android_id;
}
public String getGcm_token() {
return gcm_token;
}
public void setGcm_token(String gcm_token) {
this.gcm_token = gcm_token;
}
public String getModel() {
return model;
}
public String getDigit_id() {
return digit_id;
}
public void setDigit_id(String digit_id) {
this.digit_id = digit_id;
}
public String getObjectId() {
return objectId;
}
public void setObjectId(String objectId) {
this.objectId = objectId;
}
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
public Date getUpdated() {
return updated;
}
public void setUpdated(Date updated) {
this.updated = updated;
}
}
I want to move update of my app to google play, but I can’t because I have a lot of issues with v.4
Please help.