mybatis 單側 生成 dao model mapper
阿新 • • 發佈:2018-12-14
1、mybatis 單側程式碼
@Test public void gen() throws Exception { List<String> warnings = new ArrayList<String>(); boolean overwrite = true; ClassPathResource resource = new ClassPathResource("generator.xml"); InputStream is = resource.getInputStream(); ConfigurationParser cp = new ConfigurationParser(warnings); Configuration config = cp.parseConfiguration(is); DefaultShellCallback callback = new DefaultShellCallback(overwrite); MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, callback, warnings); myBatisGenerator.generate(null); }