// check if any columns have been removed
removeObsoleteColumns(tmpRes, valueTypeMap, cw);
// add all columns to the table
addNewColumns(tmpRes, valueTypeMap, cw);
StatementPrototypeGenerator statementGenerator = new StatementPrototypeGenerator(adapter);
StatementPrototype sp = statementGenerator.generate(s, true);
String fromName = statementGenerator.getTypeStack().getRepresentation(from.getRepresentedClass())
.getTableName();
String toName = statementGenerator.getTypeStack().getActualRepresentation().getTableName();
String prestatement = "UPDATE " + toName + " SET " + toName + "." + colName + "=" + fromName + "."
+ colName + " ";
PreparedStatement ps = sp.toPreparedStatement(cw, prestatement);
Tools.logFine(ps);
ps.executeUpdate();