public void setDirtyStatus(String dirtyStatus) { this.setValue("dirty", dirtyStatus); }
private void serializeChannels(Record record) { if(this.myChannels == null || this.myChannels.isEmpty()) { return; } int channelCount = this.myChannels.size(); record.setValue("myChannels:size", ""+channelCount); int i = 0; for(String channel: this.myChannels) { record.setValue("myChannels["+(i++)+"]", channel); } }
public void setRecordId(String recordId) { if(recordId == null || recordId.trim().length() == 0) { throw new IllegalArgumentException("Record Id cannot be empty"); } this.setValue("recordId", recordId); }
public Record getRecord() { Record record = new Record(); if(this.id != null && this.id.trim().length() > 0) { record.setRecordId(this.id); } record.setValue("source", this.source); record.setValue("target", this.target); record.setValue("guid", this.guid); record.setValue("luid", this.luid); return record; }
private void prepareRecord(Record errorRecord, ContentValues values) { String local = values.getAsString("message"); if(local != null) { errorRecord.setValue("message", local); } } }
provisioningRecord.setValue("deviceId", this.deviceId); provisioningRecord.setValue("serverId", this.serverId); provisioningRecord.setValue("serverIp", this.serverIp); provisioningRecord.setValue("plainServerPort", this.plainServerPort); provisioningRecord.setValue("secureServerPort", this.secureServerPort); provisioningRecord.setValue("authenticationHash", this.authenticationHash); provisioningRecord.setValue("authenticationNonce", this.authenticationNonce); provisioningRecord.setValue("email", this.email); provisioningRecord.setValue("cometMode", this.cometMode); provisioningRecord.setValue("cometPollInterval", ""+this.cometPollInterval); provisioningRecord.setValue("httpPort", this.httpPort); provisioningRecord.setValue("isSSLActive", ""+this.isSSLActive); provisioningRecord.setValue("maxPacketSize", ""+this.maxPacketSize); provisioningRecord.setValue("isActive", ""+this.isActive);
record.setValue("serverRecordId", this.serverRecordId); record.setValue("storageId", storageId); record.setValue("isCreatedOnDevice", Boolean.TRUE.toString()); record.setValue("isCreatedOnDevice", Boolean.FALSE.toString()); record.setValue("isLocked", Boolean.TRUE.toString()); record.setValue("isLocked", Boolean.FALSE.toString()); record.setValue("isProxy", Boolean.TRUE.toString()); record.setValue("isProxy", Boolean.FALSE.toString()); record.setValue("count", String.valueOf(this.fields.size())); record.setValue("field["+index+"].uri", field.getUri()); record.setValue("field["+index+"].name", field.getName()); record.setValue("field["+index+"].value", field.getValue()); record.setValue("arrayMetaDataCount", String.valueOf(this.arrayMetaData.size())); record.setValue("arrayMetaData["+index+"].arrayUri", local.getArrayUri()); record.setValue("arrayMetaData["+index+"].arrayLength", local.getArrayLength());
record.setValue(field, null);
private void save(Context context,String message) throws Exception { Database database = Database.getInstance(context); //insert Record errorRecord = new Record(); errorRecord.setValue("message", message); database.insert(Database.system_errors, errorRecord); }
provisioningRecord.setValue("deviceId", local); provisioningRecord.setValue("serverId", local); provisioningRecord.setValue("serverIp", local); provisioningRecord.setValue("plainServerPort", local); provisioningRecord.setValue("secureServerPort", local); provisioningRecord.setValue("authenticationHash", local); provisioningRecord.setValue("authenticationNonce", local); provisioningRecord.setValue("email", local); provisioningRecord.setValue("cometMode", local); provisioningRecord.setValue("cometPollInterval", local); provisioningRecord.setValue("httpPort", local); provisioningRecord.setValue("isSSLActive", values.getAsString("isSSLActive")); provisioningRecord.setValue("maxPacketSize", values.getAsString("maxPacketSize")); provisioningRecord.setValue("isActive",
private void setNullObject(MobileObject mobileObject, Record record, NullableObject obj, String path) { String[] fields = objectsNullableFields.get(obj.getType()); NullableObject[] innerObjects = nullableObjects.get(obj.getType()); boolean hasFields = fields != null && fields.length > 0; boolean hasInnerObjects = innerObjects != null && innerObjects.length > 0; if (!hasFields && !hasInnerObjects) { return; } //O objeto em si n tem valor no banco, então n precisa colocar nulo para "objFullname". String objPath = path + obj.getName() + OBJECT_HIERARCHY_SEPARATOR; if (hasFields) { for (String field : fields) { String fieldFullname = objPath + field; if (mobileObject.hasFieldOrArray(fieldFullname)) { continue; } record.setValue(DefaultCRUD.convertToDatabaseFormat(fieldFullname), null); } } if (hasInnerObjects) { addNullObjects(mobileObject, record, innerObjects, objPath); } }
record.setValue(DefaultCRUD.convertToDatabaseFormat(elementPath + field), null);
private void prepareToPersist(Record record, BusRegistration reg) { String dirtyStatus = record.getDirtyStatus(); record.getState().clear(); record.setRecordId(reg.getBusId()); if(reg.getInvocationHandlers() != null) { for(String handler:reg.getInvocationHandlers()) { record.setValue(handler, handler); } } if(dirtyStatus != null) { record.setDirtyStatus(dirtyStatus); } }