public Map<ElementSymbol, Expression> getVariableValues(Command command, boolean changingOnly,
QueryMetadataInterface metadata) throws QueryMetadataException,
TeiidComponentException {
Map<ElementSymbol, Expression> result = new HashMap<ElementSymbol, Expression>();
Update update = (Update) command;
Map<ElementSymbol, Expression> changing = update.getChangeList().getClauseMap();
for (Entry<ElementSymbol, Expression> entry : changing.entrySet()) {
ElementSymbol leftSymbol = entry.getKey().clone();
leftSymbol.getGroupSymbol().setName(ProcedureReservedWords.CHANGING);
result.put(leftSymbol, new Constant(Boolean.TRUE));
if (!changingOnly) {
leftSymbol = leftSymbol.clone();
leftSymbol.getGroupSymbol().setName(ProcedureReservedWords.INPUTS);
result.put(leftSymbol, entry.getValue());
}
}
Collection<ElementSymbol> insertElmnts = ResolverUtil.resolveElementsInGroup(update.getGroup(), metadata);
insertElmnts.removeAll(changing.keySet());
Iterator<ElementSymbol> defaultIter = insertElmnts.iterator();
while(defaultIter.hasNext()) {