- 授权协议: Apache
- 开发语言: Java
- 操作系统: 跨平台
- 软件首页: https://github.com/handosme/mybatis-generator-plus
- 软件文档: https://github.com/handosme/mybatis-generator-plus#mbpmybatis-generator-plus
软件介绍
1.介绍:
MyBatis generator plus 基于mybatis-generator-core v.1.3.2 扩展,增加如下主要特性:
1.生成支持Oracle、Mysql、Sqlserver分页查询的代码:
//分页查询demo OperateLogExample relationshipsExample = new OperateLogExample(); relationshipsExample.setPagination(0L,10L); List operateLogList = operateLogMapper.selectByExample(relationshipsExample);
2.生成支持Oracle、Mysql、Sqlserver批量插入的代码:
//批量插入demo
List operateLogList = new ArrayList<>();
for (int i = 0; i < 5; i++) {
OperateLog operateLog = new OperateLog.Builder()
.action("insertBatch_test"+i)
.build();
operateLogList.add(operateLog);
}
operateLogMapper.insertBatch(operateLogList);
3.Model类支持Builder模式创建,示例代码:
User user = new User.Builder()
.userName("insert_test")
.creatTime(new Date())
.updateTime(new Date())
.build();
4.支持Oracle使用SEQUENCE实现自增主键:
需要建立表主键对应的SEQUENCE,并且SEQUENCE的名称作出了要求:格式为table_name_SEQUENCE
5.支持Mapper接口设置数据源schema,可用于分库业务;
demo.mapper.ooc.UserVisitLogMapper.DATA_SOURCE_NAME
6.针对MySQL下分页大偏移量时慢查询优化List selectByBigOffset(DomainExample example);
7.乐观锁支持int updateByOptimisticLock(Domain record);
2.使用方式
方式一: 配置maven插件生成代码【推荐】
pom里plugin配置如下:
org.ihansen.mbp
mybatis-generator-plus-maven-plugin
1.4
true
true
tool/mbp/MybatisGeneratorCfg.xml
供参考的MBP配置文件: MybatisGeneratorCfg.xml
终端运行如下命令,生成自动代码:
mvn org.ihansen.mbp:mybatis-generator-plus-maven-plugin:1.4:generate
方式二:运行可执行jar文件
包含运行依赖包的可独立执行jar文件:mybatis-generator-plus-jar-with-dependencies.jar
供参考的MBP配置文件: MybatisGeneratorCfg.xml
使用如下命令执行即可生成自动文件:
java -jar mybatis-generator-plus-jar-with-dependencies-1.4.jar -configfile MybatisGeneratorCfg.xml -overwrite
方式三:main方法运行
本工具的使用方式和原生的MyBatis generator使用方式一致,兼容原生版本。maven 坐标:
org.ihansen.mbp
mybatis-generator-plus
1.4
test
生成文件的示例入口: test/demo.MBPMain
叠加体验:用互联网思维设计商业模式
穆胜 / 机械工业出版社 / 2014-11 / 39.00
本书在互联网思维改变一切的背景下,详细介绍了如何运用互联网思维重构商业模式,主要包括以下内容:①互联网经济中的商业逻辑(即“互联网思维”),不仅给出了消费方面的逻辑变革,还给出了在生产端的逻辑变革以及“跨界”的逻辑变革。②给出了一个“三层产品体验模型”,厘清了互联网思维,打造完美终端、云端服务和价值群落三层体验,企业可以选择做不同层面的体验组合,这即是选择了不同的市场策略。但是,企业要基业长青,终......一起来看看 《叠加体验:用互联网思维设计商业模式》 这本书的介绍吧!
