Skip to content

Instantly share code, notes, and snippets.

@dustingetz
Created March 20, 2011 00:24
Show Gist options
  • Select an option

  • Save dustingetz/877941 to your computer and use it in GitHub Desktop.

Select an option

Save dustingetz/877941 to your computer and use it in GitHub Desktop.
String sql_fmt = "INSERT INTO %s.%s (%s) VALUES (%s)";
String schema = context.getSchema();
String table = typeInfo.getRepeatingTableName();
CollectionUtil.transform_i(attrs, toSqlValues);
String col_sql = StringUtils.join(attrs.keySet().toArray(), ",");
String value_sql = StringUtils.join(attrs.values().toArray(), ","); //TreeSet key order maintained
String sql = String.format(sql_fmt, schema, table, col_sql, value_sql);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment