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

无法完全使用自定义插件生成sql #295

Open
lithStudy opened this issue May 9, 2020 · 0 comments
Open

无法完全使用自定义插件生成sql #295

lithStudy opened this issue May 9, 2020 · 0 comments

Comments

@lithStudy
Copy link

我想要将所有的sql都替换为自定义的插件生成,但是将mybatisGenerator内置的所有sql生成方法都关闭后,无法生成文件,关闭的代码如下: if(!generatorConfig.isUseExample()) {
tableConfig.setUpdateByExampleStatementEnabled(false);
tableConfig.setCountByExampleStatementEnabled(false);
tableConfig.setDeleteByExampleStatementEnabled(false);
tableConfig.setSelectByExampleStatementEnabled(false);
}
tableConfig.setInsertStatementEnabled(false);
tableConfig.setUpdateByPrimaryKeyStatementEnabled(false);
tableConfig.setSelectByPrimaryKeyStatementEnabled(false);
tableConfig.setDeleteByPrimaryKeyStatementEnabled(false);
,问题出在org.mybatis.generator.config.Context.introspectTables 方法,其中有如下代码片段:if (!tc.areAnyStatementsEnabled()) { warnings.add(getString("Warning.0", tableName)); //$NON-NLS-1$ continue; },会阻止继续执行,请问有没有什么办法可以绕过?

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