记一次由无参构造引发的血案(Mybatis)

问题描述

在使用Mybatis开发的过程中出现了一个严重的bug,这个异常描述如下:
org.apache.ibatis.exceptions.PersistenceException:

Error querying database. Cause: org.apache.ibatis.executor.result.ResultMapException: Error attempting to get column ‘sbxlh’ from result set. Cause: java.sql.SQLDataException: Cannot convert string ‘KF2020000002’ to java.sql.Timestamp value

The error may exist in org/apache/ibatis/submitted/typehandler/Mapper.java (best guess)

The error may involve org.apache.ibatis.submitted.typehandler.Mapper.getPictureById

The error occurred while handling results

SQL: select * from picture where id = ?

Cause: org.apache.ibatis.executor.result.ResultMapException: Error attempting to get column ‘sbxlh’ from result set. Cause: java.sql.SQLDataException: Cannot convert string ‘KF2020000002’ to java.sql.Timestamp value

at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:155)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:142)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:78)
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:94)
at org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:144)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:85)
at com.sun.proxy.$Proxy20.getPictureById(Unknown Source)
at org.apache.ibatis.submitted.typehandler.TypeHandlerTest.shouldGetPicture(TypeHandlerTest.java:161)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:686)
at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149)
at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:140)
at org.junit.jup
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值