augmentUpdates = false;
Val val = (Val) next.getValue();
if (val == null)
val = new Null();
Column col = fmd.getColumns()[0];
if (allowAlias) {
sql.append(sel.getColumnAlias(col));
} else {
sql.append(toDBName(col.getIdentifier()));
}
sql.append(" = ");
ExpState state = val.initialize(sel, ctx, 0);
// JDBC Paths are always PCPaths; PCPath implements Val
ExpState pathState = ((Val) path).initialize(sel, ctx, 0);
calculateValue(val, sel, ctx, state, path, pathState);
// 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) {
Path path = (Path) updateParams.keySet().iterator().next();
FieldMapping fm = (FieldMapping) path.last();
ClassMapping meta = fm.getDefiningMapping();
Map<Column,?> updates = meta.getVersion().getBulkUpdateValues();
for (Map.Entry e : updates.entrySet()) {
Column col = (Column) e.getKey();
Object val = e.getValue();
sql.append(", ").append(toDBName(col.getIdentifier())).append(" = ");
// Version update value for Numeric version is encoded in a String
// to make SQL such as version = version+1 while Time stamp version is parameterized
if (val instanceof String) {
sql.append((String)val);
} else {