@Override public void bindNull(int index) { delegate.bindNull(index); }
private void bindArgsToStatement(SQLiteStatement myStatement, ReadableArray sqlArgs) { for (int i = 0; i < sqlArgs.size(); i++) { ReadableType type = sqlArgs.getType(i); if (type == ReadableType.Number){ double tmp = sqlArgs.getDouble(i); if (tmp == (long) tmp) { myStatement.bindLong(i + 1, (long) tmp); } else { myStatement.bindDouble(i + 1, tmp); } } else if (sqlArgs.isNull(i)) { myStatement.bindNull(i + 1); } else { myStatement.bindString(i + 1, SQLitePluginConverter.getString(sqlArgs,i,"")); } } }
@Override public void bindNull(int index) { statement.bindNull(index); }
private void bindArgsToStatement(SQLiteStatement myStatement, ReadableArray sqlArgs) { if (sqlArgs == null) return; for (int i = 0; i < sqlArgs.size(); i++) { ReadableType type = sqlArgs.getType(i); if (type == ReadableType.Number) { double tmp = sqlArgs.getDouble(i); if (tmp == (long) tmp) { myStatement.bindLong(i + 1, (long) tmp); } else { myStatement.bindDouble(i + 1, tmp); } } else if (sqlArgs.isNull(i)) { myStatement.bindNull(i + 1); } else { myStatement.bindString(i + 1, sqlArgs.getString(i)); } } }
@Override protected synchronized long executeInsert(OsmQuest quest, boolean replace) { SQLiteStatement stmt = replace ? this.replace : this.add; if(quest.getId() != null) { stmt.bindLong(1, quest.getId()); } else { stmt.bindNull(1); } stmt.bindString(2, quest.getType().getClass().getSimpleName()); stmt.bindString(3, quest.getStatus().name()); if(quest.getChanges() != null) { stmt.bindBlob(4, serializer.toBytes(quest.getChanges())); } else { stmt.bindNull(4); } if(quest.getChangesSource() != null) stmt.bindString(5, quest.getChangesSource()); else stmt.bindNull(5); stmt.bindLong(6, new Date().getTime()); stmt.bindLong(7, quest.getElementId()); stmt.bindString(8, quest.getElementType().name()); long result = stmt.executeInsert(); stmt.clearBindings(); return result; }
private void executeInsert(Element.Type type, long id, ElementGeometry geometry) { insert.bindString(1, type.name()); insert.bindLong(2, id); if (geometry.polygons != null) insert.bindBlob(3, serializer.toBytes(geometry.polygons)); else insert.bindNull(3); if (geometry.polylines != null) insert.bindBlob(4, serializer.toBytes(geometry.polylines)); else insert.bindNull(4); insert.bindDouble(5, geometry.center.getLatitude()); insert.bindDouble(6, geometry.center.getLongitude()); insert.executeInsert(); insert.clearBindings(); }
@Override protected void executeInsert(Way way) { insert.bindLong(1, way.getId()); insert.bindLong(2, way.getVersion()); insert.bindBlob(3, serializer.toBytes(new ArrayList<>(way.getNodeIds()))); if(way.getTags() != null) { HashMap<String, String> map = new HashMap<>(way.getTags()); insert.bindBlob(4, serializer.toBytes(map)); } else { insert.bindNull(4); } insert.executeInsert(); insert.clearBindings(); }
@Override protected void executeInsert(Relation relation) { insert.bindLong(1, relation.getId()); insert.bindLong(2, relation.getVersion()); insert.bindBlob(3, serializer.toBytes(new ArrayList<>(relation.getMembers()))); if(relation.getTags() != null) { HashMap<String, String> map = new HashMap<>(relation.getTags()); insert.bindBlob(4, serializer.toBytes(map)); } else { insert.bindNull(4); } insert.executeInsert(); insert.clearBindings(); }
private void executeInsert(Note note) { insert.bindLong(1, note.id); insert.bindDouble(2, note.position.getLatitude()); insert.bindDouble(3, note.position.getLongitude()); insert.bindString(4, note.status.name()); insert.bindLong(5, note.dateCreated.getTime()); if(note.dateClosed != null) { insert.bindLong(6, note.dateClosed.getTime()); } else { insert.bindNull(6); } insert.bindBlob(7, serializer.toBytes(note.comments)); insert.executeInsert(); insert.clearBindings(); }
@Override protected synchronized long executeInsert(OsmNoteQuest quest, boolean replace) { SQLiteStatement stmt = replace ? this.replace : this.add; if(quest.getId() != null) { stmt.bindLong(1, quest.getId()); } else { stmt.bindNull(1); } stmt.bindLong(2, quest.getNote().id); stmt.bindString(3, quest.getStatus().name()); if(quest.getComment() != null) { stmt.bindString(4, quest.getComment()); } else { stmt.bindNull(4); } stmt.bindLong(5, quest.getLastUpdate().getTime()); long result = stmt.executeInsert(); stmt.clearBindings(); return result; }
/** * Adds a null value to the set. */ public void putNull() { compiledStatement.bindNull(compiledStatementBindIndex++); } // ---
/** * Adds a null value to the set. */ public void putNull() { compiledStatement.bindNull(compiledStatementBindIndex++); } // ---
@Override protected void executeInsert(Node node) { insert.bindLong(1, node.getId()); insert.bindLong(2, node.getVersion()); insert.bindDouble(3, node.getPosition().getLatitude()); insert.bindDouble(4, node.getPosition().getLongitude()); if(node.getTags() != null) { HashMap<String, String> map = new HashMap<>(node.getTags()); insert.bindBlob(5, serializer.toBytes(map)); } else { insert.bindNull(5); } insert.executeInsert(); insert.clearBindings(); }
/** * Adds a value to the set. * * @param value the data for the value to put */ public void put(Integer value) { if (value == null) { this.compiledStatement.bindNull(compiledStatementBindIndex++); } else { compiledStatement.bindLong(compiledStatementBindIndex++, value); } }
/** * Adds a value to the set. * * @param value the data for the value to put */ public void put(byte[] value) { if (value == null) { this.compiledStatement.bindNull(compiledStatementBindIndex++); } else { compiledStatement.bindBlob(compiledStatementBindIndex++, value); } }
/** * Adds a value to the set. * * @param value the data for the value to put */ public void put(Long value) { if (value == null) { this.compiledStatement.bindNull(compiledStatementBindIndex++); } else { compiledStatement.bindLong(compiledStatementBindIndex++, (long) value); } }
public static void bindDate(SQLiteStatement statement, int index, Date value) { if (value != null) { statement.bindLong(index, value.getTime()); } else { statement.bindNull(index); } }
public static void bindLong(SQLiteStatement statement, int index, Long value) { if (value != null) { statement.bindLong(index, value); } else { statement.bindNull(index); } }
/** * Adds a value to the set. * * @param value the data for the value to put */ public void put(String value) { if (value == null) { this.compiledStatement.bindNull(compiledStatementBindIndex++); } else { compiledStatement.bindString(compiledStatementBindIndex++, value); } }
/** * Adds a value to the set. * * @param value the data for the value to put */ public void put(Float value) { if (value == null) { this.compiledStatement.bindNull(compiledStatementBindIndex++); } else { compiledStatement.bindDouble(compiledStatementBindIndex++, (float) value); } }