protected ParameterBinding get(DbEntity entity, DbAttribute column) {
return values.get(createKey(entity, column));
}
public List<String> createSql(DbEntity entity, DbAttribute column) {
ParameterBinding value = get(entity, column);
if (value == null) {
return Collections.emptyList();
}
// TODO: change things so it is possible to use prepared statements here
StringBuilder sql = new StringBuilder();
sql.append("UPDATE ");
sql.append(entity.getFullyQualifiedName());
sql.append(" SET ");
sql.append(column.getName());
sql.append("='");
sql.append(value.getValue());
sql.append("' WHERE ");
sql.append(column.getName());
sql.append(" IS NULL");
return Collections.singletonList(sql.toString());
}