篇首语:本文由小编为大家整理,主要介绍了总结一下java如何进行逆向工程相关的知识,希望对你有一定的参考价值。
第一步在百度搜索Mybatis generator 在官网进行搜索 http://www.mybatis.org/generator/ 并且找到
第二步导入jar包点击See the XML Configuration File Reference page for an example of a configuration file.建立xml文件根据提示修改代码
DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">connectionURL="jdbc:mysql://localhost:3306/mybatis" userId="root" password="root"> enableCountByExample="false" enableDeleteByExample="false" enableSelectByExample="false" enableUpdateByExample="false" >
第三步运行
第四步
点击
第五步
Listwarnings = new ArrayList (); boolean overwrite = true; File configFile = new File("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);
在主函数里面导包运行
以上是关于总结一下java如何进行逆向工程的主要内容,如果未能解决你的问题,请参考以下文章