** Get the parameter type names out of the parameters and put them
** in an array.
*/
String[] parmTypeNames = getObjectSignature();
boolean[] isParam = getIsParam();
ClassInspector classInspector = getClassFactory().getClassInspector();
/*
** Find the matching constructor.
*/
try
{
/* First try with built-in types and mappings */
method = classInspector.findPublicConstructor(javaClassName,
parmTypeNames, null, isParam);
/* If no match, then retry to match any possible combinations of
* object and primitive types.
*/
if (method == null)
{
String[] primParmTypeNames = getPrimitiveSignature(false);
method = classInspector.findPublicConstructor(javaClassName,
parmTypeNames, primParmTypeNames, isParam);
}
}
catch (ClassNotFoundException e)
{
/*
** If one of the classes couldn't be found, just act like the
** method couldn't be found. The error lists all the class names,
** which should give the user enough info to diagnose the problem.
*/
method = null;
}
if (method == null)
{
/* Put the parameter type names into a single string */
String parmTypes = "";
for (int i = 0; i < parmTypeNames.length; i++)
{
if (i != 0)
parmTypes += ", ";
parmTypes += (parmTypeNames[i].length() != 0 ?
parmTypeNames[i] :
MessageService.getTextMessage(
SQLState.LANG_UNTYPED)
);
}
throw StandardException.newException(SQLState.LANG_NO_CONSTRUCTOR_FOUND,
javaClassName,
parmTypes);
}
methodParameterTypes = classInspector.getParameterTypes(method);
for (int i = 0; i < methodParameterTypes.length; i++)
{
if (ClassInspector.primitiveType(methodParameterTypes[i]))
methodParms[i].castToPrimitive(true);
}
/* Set type info for any null parameters */
if ( someParametersAreNull() )
{
setNullParameterInfo(methodParameterTypes);
}
/* Constructor always returns an object of type javaClassName */
if (SanityManager.DEBUG) {
SanityManager.ASSERT(javaClassName.equals(classInspector.getType(method)),
"Constructor is wrong type, expected " + javaClassName +
" actual is " + classInspector.getType(method));
}
setJavaTypeName( javaClassName );
if (routineInfo != null)
{
TypeDescriptor returnType = routineInfo.getReturnType();