@Testpublic void test11(){
ArrayList<String> warings = new ArrayList<String>();
boolean overwrite=true;
String getConfig="/generatorConfig.xml";
File file = new File(test1.class.getResource(getConfig).getFile());
ConfigurationParser configurationParser = new ConfigurationParser(warings);
Configuration configuration=null;
try {
configuration = configurationParser.parseConfiguration(file);
} catch (IOException e) {
e.printStackTrace();
} catch (XMLParserException e) {
e.printStackTrace();
}
DefaultShellCallback defaultShellCallback = new DefaultShellCallback(overwrite);
MyBatisGenerator myBatisGenerator=null;
try {
myBatisGenerator = new MyBatisGenerator(configuration,defaultShellCallback,warings);
} catch (InvalidConfigurationException e) {
e.printStackTrace();
} try {
myBatisGenerator.generate(null);
} catch (SQLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
mybatisGenerator的配置文件生成代码
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
相关阅读更多精彩内容
- 先创建服务端的APP 1.官网下载Winrun4j。http://winrun4j.sourceforge.net...
- 实验目的 理解四种数据库(MySQL,HBase,Redis,MongoDB)的概念以及不同点。 熟练使用四种数据...