baomidou / mybatis-plus

An powerful enhanced toolkit of MyBatis for simplify development
https://baomidou.com
Apache License 2.0
16.08k stars 4.25k forks source link

Cannot convert the column of type <unknown:7954> to requested type java.time.LocalDateTime #6298

Closed yejunhao closed 10 hours ago

yejunhao commented 1 week ago

当前使用版本 使用了3.5.3.1 当前环境信息 Java8 + 人大金仓8.6

描述bug现象 Cannot convert the column of type to requested type java.time.LocalDateTime 提供问题复现步骤 正常查询 提供完整堆栈日志(可选) Caused by: org.postgresql.util.PSQLException: Cannot convert the column of type to requested type java.time.LocalDateTime. at org.postgresql.jdbc.PgResultSet.getLocalDateTime(PgResultSet.java:727) at org.postgresql.jdbc.PgResultSet.getObject(PgResultSet.java:3760) at org.postgresql.jdbc.PgResultSet.getObject(PgResultSet.java:3780) at com.alibaba.druid.filter.FilterChainImpl.resultSet_getObject(FilterChainImpl.java:1395) at com.alibaba.druid.filter.stat.StatFilter.resultSet_getObject(StatFilter.java:878) at com.alibaba.druid.filter.FilterChainImpl.resultSet_getObject(FilterChainImpl.java:1391) at com.alibaba.druid.proxy.jdbc.ResultSetProxyImpl.getObject(ResultSetProxyImpl.java:1546) at com.alibaba.druid.pool.DruidPooledResultSet.getObject(DruidPooledResultSet.java:1765) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.ibatis.logging.jdbc.ResultSetLogger.invoke(ResultSetLogger.java:69) at com.sun.proxy.$Proxy176.getObject(Unknown Source) at org.apache.ibatis.type.LocalDateTimeTypeHandler.getNullableResult(LocalDateTimeTypeHandler.java:38) at org.apache.ibatis.type.LocalDateTimeTypeHandler.getNullableResult(LocalDateTimeTypeHandler.java:28) at org.apache.ibatis.type.BaseTypeHandler.getResult(BaseTypeHandler.java:85) 提供问题复现工程(可选) 我自己加入了还是不行

org.mybatis mybatis-typehandlers-jsr310
miemieYaho commented 1 week ago

从你报错看mybatis-typehandlers-jsr310没生效

yejunhao commented 1 week ago

从你报错看mybatis-typehandlers-jsr310没生效

您好,不是引入就可以了嘛?

miemieYaho commented 1 week ago

一般是引入就行了,你进去对应typehandlerdebug看看吧