ComplexDatabaseType complexType = (ComplexDatabaseType)type;
if (inArg.inIndex != MIN_VALUE) {
if (type instanceof PLSQLCollection) {
DatabaseType nestedType = ((PLSQLCollection)type).getNestedType();
if (nestedType != null) {
ObjectRelationalDatabaseField field =
new ObjectRelationalDatabaseField(inArg.name);
field.setSqlType(nestedType.getConversionCode());
if (nestedType.isComplexDatabaseType()) {
field.setSqlTypeName(((ComplexDatabaseType)nestedType).getCompatibleType());
}
super.addNamedArgument(inArg.name, inArg.name, type.getConversionCode(),
complexType.getCompatibleType(), field);
}
else {
super.addNamedArgument(inArg.name, inArg.name, type.getConversionCode(),
complexType.getCompatibleType());
}
}
else {
super.addNamedArgument(inArg.name, inArg.name, type.getConversionCode(),
complexType.getCompatibleType());
}
}
}
}
List<PLSQLargument> outArguments = getArguments(arguments, OUT);
outArguments.addAll(inOutArguments);
for (ListIterator<PLSQLargument> outArgsIter = outArguments.listIterator(); outArgsIter.hasNext();) {
PLSQLargument outArg = outArgsIter.next();
newIndex = outArg.databaseType.computeOutIndex(outArg, newIndex,
outArgsIter);
}
for (PLSQLargument outArg : outArguments) {
DatabaseType type = outArg.databaseType;
if (!type.isComplexDatabaseType()) {
super.addNamedOutputArgument(outArg.name, outArg.name, type.getConversionCode());
} else {
ComplexDatabaseType complexType = (ComplexDatabaseType)type;
if (outArg.outIndex != MIN_VALUE) {
if (complexType instanceof PLSQLCollection) {
DatabaseType nestedType = ((PLSQLCollection)complexType).getNestedType();
if (nestedType != null) {
ObjectRelationalDatabaseField nestedField = new ObjectRelationalDatabaseField(outArg.name);
nestedField.setSqlType(nestedType.getConversionCode());
if (nestedType.isComplexDatabaseType()) {
ComplexDatabaseType complexNestedType = (ComplexDatabaseType)nestedType;
nestedField.setType(complexNestedType.getJavaType());
nestedField.setSqlTypeName(complexNestedType.getCompatibleType());
}
super.addNamedOutputArgument(outArg.name, outArg.name, type.getConversionCode(),
complexType.getCompatibleType(), complexType.getJavaType(), nestedField);
} else {
super.addNamedOutputArgument(outArg.name, outArg.name, type.getConversionCode(), complexType.getCompatibleType());