It was either not specified and/or could not be found for the javaType (java.time.LocalDateTime)
程序员文章站
2022-07-15 16:17:07
...
总所周知,localdatetime是jdk8 推出的关于日期计算非常方便地一个类,一旦开始用上就欲罢不能。但是在使用的时候,坑还是蛮多的。
一、mybatis与LocalDatetime
如果直接将实体里面所有的Date类型换成LocalDatetime之后,运行程序是会报异常的。此时,可以加入以下依赖:
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-typehandlers-jsr310</artifactId>
<version>1.0.2</version>
</dependency>
在mybatis3,.4以上,加入该依赖即可生效。mapper等跟之前一样无需修改。
上一篇: 234.回文链表
下一篇: PHP cURL学习-大学CET查询