// set up either null result map or automatic result mapping
if (resultMap == null && resultClass == null) {
statement.setResultMap(null);
} else if (resultMap == null) {
resultMap = new AutoResultMap(vars.client.getDelegate(), "true".equals(allowRemapping));
resultMap.setId(statement.getId() + "-AutoResultMap");
resultMap.setResultClass(resultClass);
resultMap.setXmlName(xmlResultName);
resultMap.setResource(statement.getResource());
statement.setResultMap(resultMap);