final StringBuilder sql = new StringBuilder("UPDATE ").append(tableName).append(" SET ");
Chain head = chain.head();
final List<Object> values = new ArrayList<Object>();
final List<ValueAdaptor> adaptors = new ArrayList<ValueAdaptor>();
while (head != null) {
MappingField mf = null;
if (en != null)
mf = en.getField(head.name());
String colName = head.name();
if (mf != null)
colName = mf.getColumnName();
sql.append(colName).append("=");
if (head.special()) {
if (head.value() != null && head.value() instanceof String) {
String str = (String)head.value();
if (str.length() > 0) {
switch (str.charAt(0)) {
case '+':
case '-':
case '*':
case '/':
case '%':
case '&':
case '^':
case '|':
sql.append(colName);
break;
}
}
}
sql.append(head.value());
} else {
sql.append("?");
values.add(head.value());
ValueAdaptor adaptor = Jdbcs.getAdaptorBy(head.value());
if (mf != null && mf.getAdaptor() != null)
adaptor = mf.getAdaptor();
adaptors.add(adaptor);
}
sql.append(" ");
head = head.next();
if (head != null)