下面仅仅介绍MyBatis3模式的代码生成。

  • Post author:
  • Post category:其他


public class MBGTool {


public static void main(String[] args) throws Exception {


List warnings = new ArrayList<>();

boolean overwrite = true;

InputStream configFile = MBGTool.class.getResourceAsStream(“/generator/generatorConfig.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);

}

}

public class MBGTool {


public static void main(String[] args) throws Exception {


List warnings = new ArrayList<>();

boolean overwrite = true;

InputStream configFile = MBGTool.class.getResourceAsStream(“/generator/generatorConfig.xml”);

Configuration



版权声明:本文为qq_38512939原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。