private Object prepareDomParameterObject(ResultSet rs, ResultMapping mapping) throws SQLException {
TypeHandlerFactory typeHandlerFactory = getDelegate().getTypeHandlerFactory();
Document doc = newDocument("parameter");
Probe probe = ProbeFactory.getProbe(doc);
String complexName = mapping.getColumnName();
TypeHandler stringTypeHandler = typeHandlerFactory.getTypeHandler(String.class);
if (complexName.indexOf('=') > -1) {
// old 1.x style multiple params
StringTokenizer parser = new StringTokenizer(complexName, "{}=, ", false);
while (parser.hasMoreTokens()) {
String propName = parser.nextToken();
String colName = parser.nextToken();
Object propValue = stringTypeHandler.getResult(rs, colName);
probe.setObject(doc, propName, propValue.toString());
}
} else {
// single param
Object propValue = stringTypeHandler.getResult(rs, complexName);
probe.setObject(doc, "value", propValue.toString());
}
return doc;
}