逆向工程,生成pojo、xml、mapper
2024-08-27 22:18:28
package com.how2java; import java.io.File;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List; import org.mybatis.generator.api.MyBatisGenerator;
import org.mybatis.generator.config.Configuration;
import org.mybatis.generator.config.xml.ConfigurationParser;
import org.mybatis.generator.internal.DefaultShellCallback; public class TestMybatisGenerator { public static void main(String[] args) throws Exception {
List<String> warnings = new ArrayList<String>();
boolean overwrite = true;
InputStream is= TestMybatisGenerator.class.getClassLoader().getResource("generatorConfig.xml").openStream();
ConfigurationParser cp = new ConfigurationParser(warnings);
Configuration config = cp.parseConfiguration(is);
is.close();
DefaultShellCallback callback = new DefaultShellCallback(overwrite);
MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, callback, warnings);
myBatisGenerator.generate(null);
System.out.println("成功啦哈哈哈"); }
}
最新文章
- InnoDB:Lock &; Transaction
- bzoj 4326: NOIP2015 运输计划
- Quartz.NET开源作业调度框架系列(四):Plugin Job
- 说说React
- barabasilab-networkScience学习笔记5- Barab&#225;si-Albert 模型
- 0518 Scrum项目5.0
- 在XE5中 VCL空窗体的3个线程
- ExecutorService - 10个技巧和窍门
- Unigui有用的网址
- postgresql info
- iOS 错误 之 http请求
- prop解决一个checkbox选中后再次选中失效的问题
- 基于LVDS/M-LVDS的数据通信
- 扩展Lucas定理
- group by搭配 order by解决排序问题
- cJSON库的简单介绍及使用
- Solr的Filed中indexed与stored属性
- Block 语法
- Java常用排序算法及性能测试集合
- RESTful api架构设计