标签:http generator test png directory anon .com config parser
1:引入pom
2:增加生成配置xml:
3:增加java类:
代码:
List<String> warnings = new ArrayList<String>(); boolean overwrite = true; File directory = new File("");// 参数为空 String courseFile = directory.getCanonicalPath(); File configFile = new File(courseFile+"/src/test/java/generatorConfig.xml");//mbg.xml为上面创建的配置文件。 ConfigurationParser cp = new ConfigurationParser(warnings); Configuration config = cp.parseConfiguration(configFile); DefaultShellCallback callback = new DefaultShellCallback(overwrite); MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, callback, warnings); myBatisGenerator.generate(null);
ok。
标签:http generator test png directory anon .com config parser
原文地址:https://www.cnblogs.com/caozengling/p/9503337.html