版本:
shardingsphere 4.1.0(4.4.1)+mybatis-plus 3.3.1 druid 1.1.19(至1.1.23)
Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: Error attempting to get column 'create_time' from result set. Cause: java.sql.SQLFeatureNotSupportedException: getObject with type
; getObject with type; nested exception is java.sql.SQLFeatureNotSupportedException: getObject with type] with root cause
java.sql.SQLFeatureNotSupportedException: getObject with type
at org.apache.shardingsphere.shardingjdbc.jdbc.unsupported.AbstractUnsupportedOperationResultSet.getObject(AbstractUnsupportedOperationResultSet.java:221) ~[sharding-jdbc-core-4.1.1.jar:4.1.1]
at org.apache.ibatis.type.LocalDateTimeTypeHandler.getNullableResult(LocalDateTimeTypeHandler.java:38) ~[mybatis-3.5.3.jar:3.5.3]
错误原因:
数据库字段create_time 对应实体类型 LocalDateTime(java 8)
网上好多说是由于连接池druid版本连接池导致,但我换到1.1.23还是不可以;
后来更换连接池为HikariCP,但还是不支持这个时间类型;
只有降低mybatis-plus 为3.1.0 可以;
但项目中mybatis是不允许降版本的,有解决办法的大佬不?