@Test public void insertSqlArgs() { String result = Utils.insertSqlArgs("? ?", new Object[]{1, "hej"}); assertEquals(result, "1 'hej'"); }
static String insertSqlArgs(String sql, Object[] args) { if (args == null) { return sql; } for (Object o : args) { TypeSerializer typeSerializer = Sprinkles.sInstance.getTypeSerializer(o.getClass()); String sqlObject = typeSerializer.toSql(o); sql = sql.replaceFirst("\\?", sqlObject); } return sql; }
Utils { static String insertSqlArgs(String sql, Object[] args) { if (args == null) { return sql; } for (Object o : args) { TypeSerializer typeSerializer = Sprinkles.sInstance.getTypeSerializer(o.getClass()); String sqlObject = typeSerializer.toSql(o); sql = sql.replaceFirst("\\?", sqlObject); } return sql; } }
Utils { static String insertSqlArgs(String sql, Object[] args) { if (args == null) { return sql; } for (Object o : args) { TypeSerializer typeSerializer = Sprinkles.sInstance.getTypeSerializer(o.getClass()); String sqlObject = typeSerializer.toSql(o); sql = sql.replaceFirst("\\?", sqlObject); } return sql; }  }
Utils { static String insertSqlArgs(String sql, Object[] args) { if (args == null) { return sql; } for (Object o : args) { TypeSerializer typeSerializer = Sprinkles.sInstance.getTypeSerializer(o.getClass()); String sqlObject = typeSerializer.toSql(o); sql = sql.replaceFirst("\\?", sqlObject); } return sql; }   }
Utils { static String insertSqlArgs(String sql, Object[] args) { if (args == null) { return sql; } for (Object o : args) { TypeSerializer typeSerializer = Sprinkles.sInstance.getTypeSerializer(o.getClass()); String sqlObject = typeSerializer.toSql(o); sql = sql.replaceFirst("\\?", sqlObject); } return sql; }    }