public static PrimaryKey id(Object value) { return new PrimaryKey("ID", value); }
public Builder dump(AbstractInsertable insertable, long id) { PrimaryKey pk = PrimaryKey.id(id); return dumpWithPk(insertable, pk); }
public String toUpdate(PrimaryKey primaryKey) { int insertValueListSize = insertValueList.size(); List<String> columnNameList = newArrayListWithCapacity(insertValueListSize); for (InsertValue insertValue : insertValueList) { columnNameList.add(insertValue.toUpdate()); } String columns = Joiner.on(",").join(columnNameList); String keyColumn = primaryKey.columnName(); Object val = primaryKey.value(); addValue(keyColumn, ParamValue.valueOf(next(), val)); return String.format("update %s set %s where `%s`=?", table, columns, primaryKey.columnName()); }
public SqlDump toSqlDump(PrimaryKey pk) { boolean contained = false; for (InsertValue insertValue : insertValueList) { if (insertValue.isColumnNameEqual(pk.columnName())) { contained = true; break; } } return contained ? toSqlDump() : SqlDump.newSqlDump(table, insertValueList, pk); }
static SqlDumpStatement newStatement(String tableName, List<InsertValue> insertValueList, PrimaryKey pk, ParamValueFactory factory) { int insertValueListSize = insertValueList.size(); List<InsertValue> newInserValueList = new ArrayList<>(1 + insertValueListSize); newInserValueList.addAll(insertValueList); newInserValueList.add(pk.toInsertValue(factory, 1 + insertValueListSize)); return new SqlDumpStatement(tableName, newInserValueList); }
public Builder dump(AbstractListInsertable insertable, String id) { PrimaryKey pk = PrimaryKey.id(id); return dumpWithPk(insertable, pk); }
public String toUpdate(PrimaryKey primaryKey) { int insertValueListSize = insertValueList.size(); List<String> columnNameList = new ArrayList<>(insertValueListSize); for (InsertValue insertValue : insertValueList) { columnNameList.add(insertValue.toUpdate()); } String columns = columnNameList.stream().collect(Collectors.joining(",")); String keyColumn = primaryKey.columnName(); Object val = primaryKey.value(); addValue(keyColumn, paramValue(next(), val)); return String.format("update %s set %s where `%s`=?", table, columns, primaryKey.columnName()); }
public SqlDump toSqlDump(PrimaryKey pk) { boolean contained = false; for (InsertValue insertValue : insertValueList) { if (insertValue.isColumnNameEqual(pk.columnName())) { contained = true; break; } } return contained ? toSqlDump() : SqlDump.newSqlDump(table, insertValueList, pk, paramValueFactory()); }
static SqlDumpStatement newStatement(String tableName, List<InsertValue> insertValueList, PrimaryKey pk) { int insertValueListSize = insertValueList.size(); List<InsertValue> newInserValueList = newArrayListWithCapacity(1 + insertValueListSize); newInserValueList.addAll(insertValueList); newInserValueList.add(pk.toInsertValue(1 + insertValueListSize)); return new SqlDumpStatement(tableName, newInserValueList); }
public Builder dump(Insertable insertable, long id) { PrimaryKey pk = PrimaryKey.id(id); return dumpWithPk(insertable, pk); }
public String toUpdate(PrimaryKey primaryKey) { int insertValueListSize = insertValueList.size(); List<String> columnNameList = new ArrayList<>(insertValueListSize); for (InsertValue insertValue : insertValueList) { columnNameList.add(insertValue.toUpdate()); } String columns = columnNameList.stream().collect(Collectors.joining(",")); String keyColumn = primaryKey.columnName(); Object val = primaryKey.value(); addValue(keyColumn, paramValue(next(), val)); return String.format("update %s set %s where `%s`=?", table, columns, primaryKey.columnName()); }
public static PrimaryKey id(Object value) { return new PrimaryKey("ID", value); }
public SqlDump toSqlDump(PrimaryKey pk) { boolean contained = false; for (InsertValue insertValue : insertValueList) { if (insertValue.isColumnNameEqual(pk.columnName())) { contained = true; break; } } return contained ? toSqlDump() : SqlDump.newSqlDump(table, insertValueList, pk, paramValueFactory()); }
static SqlDumpStatement newStatement(String tableName, List<InsertValue> insertValueList, PrimaryKey pk, ParamValueFactory factory) { int insertValueListSize = insertValueList.size(); List<InsertValue> newInserValueList = new ArrayList<>(1 + insertValueListSize); newInserValueList.addAll(insertValueList); newInserValueList.add(pk.toInsertValue(factory, 1 + insertValueListSize)); return new SqlDumpStatement(tableName, newInserValueList); }
public Builder dump(Insertable insertable, String id) { PrimaryKey pk = PrimaryKey.id(id); return dumpWithPk(insertable, pk); }
public static PrimaryKey named(String columnName, Object value) { return new PrimaryKey(columnName, value); }
public Builder dump(AbstractListInsertable insertable, long id) { PrimaryKey pk = PrimaryKey.id(id); return dumpWithPk(insertable, pk); }
public static PrimaryKey named(String columnName, Object value) { return new PrimaryKey(columnName, value); }
public Builder dump(AbstractListInsertable insertable, long id) { PrimaryKey pk = PrimaryKey.id(id); return dumpWithPk(insertable, pk); }
public static PrimaryKey id(Object value) { return new PrimaryKey("ID", value); }