use of org.jkiss.dbeaver.model.struct.rdb.DBSProcedure in project dbeaver by serge-rider.
the class SQLCompletionProposalBase method getExtraString.
public String getExtraString() {
try {
VoidProgressMonitor monitor = new VoidProgressMonitor();
if (object instanceof DBSObjectReference) {
if (DBSProcedure.class.isAssignableFrom(((DBSObjectReference) object).getObjectType().getTypeClass())) {
object = ((DBSObjectReference) object).resolveObject(monitor);
}
}
if (object instanceof DBSProcedure) {
// Ad parameter marks
boolean isExec = CommonUtils.toBoolean(params.get(PARAM_EXEC));
Collection<? extends DBSProcedureParameter> parameters = ((DBSProcedure) object).getParameters(monitor);
if (!CommonUtils.isEmpty(parameters)) {
StringBuilder params = new StringBuilder();
for (DBSProcedureParameter param : parameters) {
if (param.getParameterKind().isInput()) {
if (params.length() > 0)
params.append(", ");
if (isExec) {
params.append(":").append(param.getName());
} else {
params.append(param.getParameterType().getFullTypeName());
}
}
}
return "(" + params.toString() + ")";
} else {
return "()";
}
}
return null;
} catch (DBException e) {
log.error("Error resolving procedure parameters", e);
return null;
}
}
Aggregations