上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 67 下一页
摘要: 1、拦截器 controller MyBatisPlusConfig package com.wt.config; import com.baomidou.mybatisplus.extension.plugins.OptimisticLockerInterceptor; import com.ba 阅读全文
posted @ 2020-07-21 20:38 市丸银 阅读(1419) 评论(0) 推荐(0) 编辑
摘要: 作用:保护数据安全,多线程下加锁 过程: 1、先查询,获取当前的版本号 2、若版本号,不对则更新失败 使用 1、在数据库中添加version 字段 2、实现类 package com.wt.pojo; import com.baomidou.mybatisplus.annotation.*; imp 阅读全文
posted @ 2020-07-21 13:26 市丸银 阅读(285) 评论(0) 推荐(0) 编辑
摘要: 前提: 在数据苦中添加 create_time 和 update_time字段 1、实体类 package com.wt.pojo; import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatispl 阅读全文
posted @ 2020-07-21 13:01 市丸银 阅读(725) 评论(0) 推荐(0) 编辑
摘要: 一、Insert 主键生成策略 1、雪花算法(默认) 插入语句 @Test public void insertSql(){ User user = new User(); user.setName("wt"); user.setAge(10); user.setEmail("1589574809@ 阅读全文
posted @ 2020-07-21 10:41 市丸银 阅读(5138) 评论(0) 推荐(0) 编辑
摘要: 在application.yaml文件中开启日志 #开启日志 mybatis-plus: configuration: log-impl: org.apache.ibatis.logging.stdout.StdOutImpl 阅读全文
posted @ 2020-07-21 10:19 市丸银 阅读(1865) 评论(0) 推荐(0) 编辑
摘要: 注意: 数据库中的字段 last_name 与 实体类中的 lastName 一致 官网:https://mp.baomidou.com/guide/#%E7%89%B9%E6%80%A7 一、环境 1、配置maven <!-- 数据库驱动--> <dependency> <groupId>mysq 阅读全文
posted @ 2020-07-21 10:14 市丸银 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 创建项目的时候,开启热部署 参考: https://www.cnblogs.com/scorpio-xinghen/p/11660203.html 1、maven 添加 <dependency> <groupId>org.springframework.boot</groupId> <artifac 阅读全文
posted @ 2020-07-20 21:50 市丸银 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 参考文档 https://www.cnblogs.com/msi-chen/p/10974009.html#_label1_0 一、准备工作 1、导包 或 创建项目时勾选 <dependency> <groupId>org.thymeleaf</groupId> <artifactId>thymel 阅读全文
posted @ 2020-07-20 19:57 市丸银 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 看源码 WebMvcAutoConfiguration.java 优先级:访问:localhost:8080/ resources > static >public 关闭模板缓存 spring: thymeleaf: cache: false https://www.cnblogs.com/wt70 阅读全文
posted @ 2020-07-20 19:14 市丸银 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 一、优先级 1、文件路径 file:./config/ file:./config/*/ file:./ classpath:/config/ classpath:/ 2、优先级 二、配置不同的开发环境 application.yml spring: profiles: active: online 阅读全文
posted @ 2020-07-20 17:41 市丸银 阅读(136) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 67 下一页