context.accessedPlanningObject(id);
}
}
// propagate procedure parameters to the plan to allow runtime type checking
ProcedureContainer container = (ProcedureContainer)cupc.getUserCommand();
ProcedurePlan plan = (ProcedurePlan)result;
if (container != null) {
LinkedHashMap<ElementSymbol, Expression> params = container.getProcedureParameters();
if (container instanceof StoredProcedure) {
plan.setRequiresTransaction(container.getUpdateCount() > 0);
StoredProcedure sp = (StoredProcedure)container;
if (sp.returnParameters()) {
List<ElementSymbol> outParams = new LinkedList<ElementSymbol>();
for (SPParameter param : sp.getParameters()) {
if (param.getParameterType() == SPParameter.RETURN_VALUE) {
outParams.add(param.getParameterSymbol());
}
}
for (SPParameter param : sp.getParameters()) {
if (param.getParameterType() == SPParameter.INOUT ||
param.getParameterType() == SPParameter.OUT) {
outParams.add(param.getParameterSymbol());
}
}
if (outParams.size() > 0) {
plan.setOutParams(outParams);
}
}
}
plan.setParams(params);
plan.setMetadata(metadata);
if (container instanceof TranslatableProcedureContainer) {
plan.setImplicitParams(((TranslatableProcedureContainer)container).getImplicitParams());
}
}
break;
case Command.TYPE_BATCHED_UPDATE:
result = BATCHED_UPDATE_PLANNER.optimize(command, idGenerator, metadata, capFinder, analysisRecord, context);