Open wushugenzz opened 11 months ago
/** * 配置指定的接口 * * @param configuration * @param mapperInterface */ public void processConfiguration(Configuration configuration, Class<?> mapperInterface) { String prefix; if (mapperInterface != null) { prefix = mapperInterface.getCanonicalName(); } else { prefix = ""; } for (Object object : new ArrayList<Object>(configuration.getMappedStatements())) { if (object instanceof MappedStatement) { MappedStatement ms = (MappedStatement) object; if (ms.getId().startsWith(prefix)) { processMappedStatement(ms); } } } } spring实例化Mapper时,对mapper接口时,配置指定接口时,会对所有MapperStatements做循环,目前实例化mapper耗时太久