BUG02 - [環境紛争、または公式ドキュメントを参照する]など、MPのバージョンが高いバージョン、JDK8日期新类型のLocalDateTimeからバージョン3.1.0へと下にアップグレードするには(エラー)をマッピングすることはできません

バージョン3.1.0からアップグレードMP等より高いバージョン、JDK8日期新类型LocalDateTimeを、へのバージョンの下に(エラー)をマッピングすることができません

MP公式サイトの説明から以下の輸送

Error attempting to get column 'create_time' from result set. Cause: java.sql.SQLFeatureNotSupportedException
3.1.0之前版本没问题,针对3.1.1以及后续版本出现上述问题

    现象: 集成druid数据源,使用3.1.0之前版本没问题,升级mp到3.1.1+后,运行时报错:java.sql.SQLFeatureNotSupportedException

    原因: mp3.1.1+使用了新版jdbc,LocalDateTime等新日期类型处理方式升级,但druid在1.1.21版本之前不支持,参考issue

    解决方案: 1. 升级druid到1.1.21解决这个问题;2.保持mp版本3.1.0;3.紧跟mp版本,换掉druid数据源

#mp版本从3.1.0及以下版本升级到高版本,JDK8日期新类型LocalDateTime等无法映射(报错)
    MP_3.1.0及之前的版本,依赖的是mybatis 3.5.0,

    MP_3.1.1升级了mybatis的依赖到3.5.1, 而mybatis 3.5.1 对于新日期类型,需要JDBC driver支持JDBC 4.2 API.

    如果你的jdbc驱动版本不支持,那么就会出现新日期类型报错。

    参考 blog.mybatis.org

There is one backward incompatible changes since 3.5.0.
    Because of the fix for #1478 , LocalDateTypeHandler, LocalTimeTypeHandler and LocalDateTimeTypeHandler now require a JDBC driver that supports JDBC 4.2 API.
    [EDIT] These type handlers no longer work with Druid. Please see #1516 .
#Failed to bind properties under 'mybatis-plus.configuration.incomplete-result-maps[0].assistant.configuration.mapped-statements[0].parameter-map.parameter-mappings[0]' to org.apache.ibatis.mapping.ParameterMapping
springboot 2.2.0 之前无此问题, springboot 2.2.0 出现此问题

现象: 1.本地启动无问题,打成war包部署到服务器报此问题

    原因:springboot 2.2.0 构造器注入的问题, mybatis 私有构造器不能绑定属性, 造成依赖mybatis的框架比如MP报错 [参考issue](https://github.com/spring-projects/spring-boot/issues/18670) 此问题已在springboot2.2.1中修复

    解决方案:1.将springboot降级到2.1.x或升级到2.2.1起 (建议springboot2.2.2)

使用java.util.Date

おすすめ

転載: www.cnblogs.com/zhazhaacmer/p/12197988.html