mybatis-plus 中的LocalDateTime, LocalDate, LocalTime
#Mybatis 从3.4.5 开始,默认支持 JSR-310(日期和时间 API)
即java.time.* 下的时间类自动类型转换
本文使用的依赖
<dependency> <groupId>com.alibaba</groupId> <artifactId>druid-spring-boot-starter</artifactId> <version>1.1.17</version> </dependency> <dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-boot-starter</artifactId> <version>3.3.1</version> </dependency>
查询时, 会发现如下错误
org.springframework.dao.InvalidDataAccessApiUsageException: Error attempting to get column ‘date‘ from result set. Cause: java.sql.SQLFeatureNotSupportedException; null; nested exception is java.sql.SQLFeatureNotSupportedException
查看pom文件发现, mybatis版本高于3.4.5
与数据库相关的依赖处理mybatis还有druid, 最后发现是druid的依赖出错了
修改为如下版本:
<dependency> <groupId>com.alibaba</groupId> <artifactId>druid-spring-boot-starter</artifactId> <version>1.1.22</version> </dependency>
相关推荐
Greatemperor 2020-07-19
shenzhenzsw 2020-07-18
yogoma 2020-06-25
丽丽 2020-05-19
yangyutong00 2020-04-16
meylovezn 2020-03-23
蜡笔小鑫爱看雪 2020-03-01
CloudXli 2020-02-21
leodengzx 2020-01-31
LczPtr 2019-12-28
83560193 2013-06-25
chouliqingke 2019-12-18
xiaoxiaoniaoer 2019-12-18
啦啦啦啦啦 2019-12-08
逍遥友 2019-12-04
84096424 2019-10-23
BrotherDong0 2019-08-07