Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

希望优化:MapperHelper#processConfiguration,配置指定接口时,会对所有MapperStatements做循环 #892

Open
wushugenzz opened this issue Oct 19, 2023 · 0 comments

Comments

@wushugenzz
Copy link

/**
 * 配置指定的接口
 *
 * @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耗时太久
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant