if (fmd.isVersion())
augmentUpdates = false;
Val val = (Val) next.getValue();
Column col = fmd.getColumns()[0];
sql.append(col.getName());
sql.append(" = ");
ExpState state = val.initialize(sel, ctx, 0);
val.calculateValue(sel, ctx, state, null, null);
// append the value with a null for the Select; i
// indicates that the
int length = val.length(sel, ctx, state);
for (int j = 0; j < length; j++)
val.appendTo((allowAlias) ? sel : null, ctx, state, sql, j);
if (i.hasNext())
sql.append(", ");
}
if (augmentUpdates) {
ClassMapping meta =
((FieldMapping) updateParams.keySet().iterator().next())
.getDeclaringMapping();
Map updates = meta.getVersion().getBulkUpdateValues();
for (Iterator iter = updates.entrySet().iterator();
iter.hasNext(); ) {
Map.Entry e = (Map.Entry) iter.next();
Column col = (Column) e.getKey();
String val = (String) e.getValue();
sql.append(", ").append(col.getName())
.append(" = ").append(val);
}
}
}