mybatis-plus 3.0-RC 发布,代号:超级棒棒糖

栏目: 数据库 · 发布时间: 7年前

Mybatis-Plus 是一款 Mybatis 动态 SQL 自动注入 Mybatis 增删改查 CRUD 操作中间件, 减少你的开发周期优化动态维护 XML 实体字段,无入侵全方位 ORM 辅助层让您拥有更多时间陪家人。

mybatis-plus 3.0-RC 发布,代号:超级棒棒糖

Mybatis-Plus 3.X 架构图

  • annotation  注解相关

  • extension 扩展插件

  • core     核心功能

  • generator 代码生成器

  • boot-starter 快速集成 spring boot

GITEE GITHUB 文档地址

MP3 升级日志:

  • 优化 page 当 size 小于 0 自动调整为 list 模式

  • 新增 攻击 SQL 阻断解析器

  • 优化解析核心方法名,新增 querywrapper lambda 转换参数测试

  • 调整通用 service 层方法命名为阿里规范 ( 小白鼠,对不起,请唾弃我们吧!然后修改下您的项目。)

  • 代码生成器允许正则表达式匹配表名

  • 乐观锁 回写更新后的version到实体

  • 修复 Gitee issues/ILEYD

  • Page 的序列化接口挪到 IPage 接口

  • 解决了 gamma 不能自动赋值 ID

  • 代码改个常量引用优化

1、强大的条件构造器

// SQL: SELECT name, age FROM user WHERE sex=1 AND ( age=3 OR age =5 ) AND name LIKE '%MP3%'
new QueryWrapper<User>(可传实体条件,字符串类型默认模糊查询)
.lambda().select(User::getName, User::getAge)
.eq(User::getSex, 1)
.and(i -> i.eq(User::getAge, 3).or().eq(User::getAge, 5))
.like(User::getName, "MP3");

2、 无限制的分页模型设计

// 分页 Mapper 层直接返回 IPage 接口,让分页模型完全自定义
IPage page = baseMapper.selectPage(page, ...);

3、通用 Api Controller 层

@GetMapping("/api")
public ApiResult<String> testApi(String content) {
   ApiAssert.isNull(ErrorCode.TEST, content);
   return success(content);
}

更多姿势!期待您的发现 ...


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Implementing Responsive Design

Implementing Responsive Design

Tim Kadlec / New Riders / 2012-7-31 / GBP 27.99

New devices and platforms emerge daily. Browsers iterate at a remarkable pace. Faced with this volatile landscape we can either struggle for control or we can embrace the inherent flexibility of the w......一起来看看 《Implementing Responsive Design》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

SHA 加密
SHA 加密

SHA 加密工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具