项目总结
文章平均质量分 50
FromZeroToPerfect
小白的后端开发之路
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
项目日志出现:syntax error, error in :‘it 5 LIMIT ? ‘, expect LIMIT, actual LIMIT pos 问题
今天检查项目日志时发现了这样一个问题:syntax error, error in :'it 5 LIMIT ? ', expect LIMIT, actual LIMIT pos问题出现原因:由于在项目中使用了PageHelper分页插件,PageHelper 方法使用了静态的 ThreadLocal 参数,分页参数和线程是绑定的。只要你可以保证在 PageHelper 方法调用后紧跟 MyBatis 查询方法,这就是安全的。因为 PageHelper 在 finally 代码段中自动清除了 T原创 2020-12-24 11:07:57 · 4131 阅读 · 0 评论 -
Mybatis Plus主键 Could not set property ‘id‘ of ‘class xxxx with value‘‘;Cause:argument type mismatch
Mybatis Plus支持以下4种主键策略:IdType.AUTO 数据库ID自增(常用)IdType.INPUT 用户输入IDIdType.ID_WORKER 全局唯一ID,内容为空自动填充(默认配置),会返回一个Long类型值作为ID,如果id定义为Integer类型,就会报参数类型不匹配错误IdType.UUID 全局唯一ID,内容为空自动填充...原创 2020-11-07 18:36:27 · 771 阅读 · 0 评论 -
两种使用list.stream().collect()方式:Collectors.toMap,Collectors.mapping
list->map键值对映射关系:List<Platform> platformList = platformService.listAll();Map<Integer, String> platformMap = null;if (platformList != null && platformList.size() > 0) { platformMap = platformList.stream().collect(Collectors.原创 2020-11-06 13:16:07 · 4315 阅读 · 0 评论 -
使用SimpleDateFormat格式化日期
常用:SimpleDateFormat simpleDateFormat =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");System.out.println(simpleDateFormat.format(new Date()));y 四位数年份M 月d 日h 时 在上午或下午 (1~12)H 时 在一天中 (0~23)m 分s 秒...原创 2020-11-04 16:16:50 · 371 阅读 · 0 评论 -
SpringBoot整合Mybatis反向生成时报错
Mysql 8.0.17mybatis-generator-maven-plugin 1.3.5mapper-spring-boot-starter 2.0.2druid-spring-boot-starter 1.1.101.错误一:数据库版本与本地版本不匹配(记住有两个,Maven插件里还有一个)2.错误二:关于Mysql 8.x的错误①配置url必须加时区&se...原创 2019-12-04 00:47:48 · 261 阅读 · 0 评论
分享