摘要: 官方文档:https://mybatis.plus/ 官方样例地址:https://gitee.com/baomidou/mybatis-plus-samples 零、MybatisPlus特性: 无侵入,损耗小,强大的CRUD操作。 支持Lambda形式调用,支持多种数据库。 支持主键自动生成,支 阅读全文
posted @ 2020-10-26 14:03 天乔巴夏丶 阅读(2461) 评论(0) 推荐(1) 编辑
摘要: 有时我们希望在更新数据的时候,自动完成某些字段的值的填充,如创建一个实体的时候,自动生成创建时间,更新的时候自动改变更新时间等。 在指定字段标注注解,生成器策略部分也可以配置。 // 创建时间 @TableField(fill = FieldFill.INSERT) private Date cre 阅读全文
posted @ 2020-10-26 14:02 天乔巴夏丶 阅读(1861) 评论(0) 推荐(0) 编辑
摘要: 本文代码样例均已上传至Gitee:https://gitee.com/tqbx/springboot-samples-learn/tree/master/spring-boot-mybatis-plus-primer 乐观锁适用于读多写少的场景。 乐观锁的实现机制: 取出记录时,获取当前versio 阅读全文
posted @ 2020-10-26 13:50 天乔巴夏丶 阅读(1249) 评论(1) 推荐(0) 编辑
摘要: 本文代码样例均已上传至Gitee:https://gitee.com/tqbx/springboot-samples-learn/tree/master/spring-boot-mybatis-plus-primer 核心插件: TenantLineInnerInterceptor 核心处理器:Te 阅读全文
posted @ 2020-10-26 13:46 天乔巴夏丶 阅读(5522) 评论(0) 推荐(0) 编辑
摘要: 本文代码样例均已上传至Gitee:https://gitee.com/tqbx/springboot-samples-learn 基本使用 创建方法的类,继承AbstractMethod。 /** * * 删除全部 * @author Summerday */ public class Delete 阅读全文
posted @ 2020-10-26 13:40 天乔巴夏丶 阅读(2983) 评论(0) 推荐(0) 编辑