protected void setSingleResult(XRServiceAdapter xrService, StoredProcedureCall spCall, QName resultType) {
if (isCursorType(xrService, resultType)) {
spCall.useUnnamedCursorOutputAsResultSet();
}
else {
StoredFunctionCall sfCall = (StoredFunctionCall)spCall;
Class<?> clz = SCHEMA_2_CLASS.get(resultType);
if (clz != null) {
sfCall.setResult("", clz);
}
else {
sfCall.setResult("", OBJECT);
}
DatabasePlatform platform = xrService.getORSession().getPlatform();
if (platform == null) {
platform = new DatabasePlatform();
}
// StoredFunction's return value is the first parameter
((DatabaseField)sfCall.getParameters().firstElement()).setSqlType(
platform.getJDBCType(clz));
}
}