}
// Multiple ResultSet handling
if (callback.getRowHandler() instanceof DefaultRowHandler) {
MappedStatement statement = statementScope.getStatement();
DefaultRowHandler defaultRowHandler = ((DefaultRowHandler) callback.getRowHandler());
if (statement.hasMultipleResultMaps()) {
List multipleResults = new ArrayList();
multipleResults.add(defaultRowHandler.getList());
ResultMap[] resultMaps = statement.getAdditionalResultMaps();
int i = 0;
while (moveToNextResultsSafely(statementScope, ps)) {
if (i >= resultMaps.length) break;
ResultMap rm = resultMaps[i];
statementScope.setResultMap(rm);
rs = ps.getResultSet();
DefaultRowHandler rh = new DefaultRowHandler();
handleResults(statementScope, rs, skipResults, maxResults, new RowHandlerCallback(rm, null, rh));
multipleResults.add(rh.getList());
i++;
}
defaultRowHandler.setList(multipleResults);
statementScope.setResultMap(statement.getResultMap());
} else {