boolean firstSet = true;
List columnList = new ArrayList(columns.length);
sqlBuffer.append(" set ");
for (int i = 0; i < columns.length; i++)
{
Column column = columns[i];
// set if not primary key
if (Columns.getColumn(column.getColumnName(), primaryKeys) == null)
{
if (!firstSet)
{
sqlBuffer.append(", ");
}
firstSet = false;
// escape column name
String columnName = getQualifiedName(null,
column.getColumnName(), connection);
sqlBuffer.append(columnName);
sqlBuffer.append(" = ?");
columnList.add(column);
}
}
// where
sqlBuffer.append(" where ");
for (int i = 0; i < primaryKeys.length; i++)
{
Column column = primaryKeys[i];
if (i > 0)
{
sqlBuffer.append(" and ");
}
// escape column name
String columnName = getQualifiedName(null,
column.getColumnName(), connection);
sqlBuffer.append(columnName);
sqlBuffer.append(" = ?");
columnList.add(column);
}