java mybits集成 数据类型转换错误
java中的Long类型对应mybits的javaType是什么类型,我用BIGINT的,但是修改的时候报错
Exception in thread "main" org.mybatis.spring.MyBatisSystemException:
nested exception is org.apache.ibatis.exceptions.PersistenceException:
### Error updating database. Cause:
java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer
### The error may involve net.makshi.data.site.persistence.FundSnapshotMapper.updateFundSnapshot-Inline
### The error occurred while setting parameters
### Cause:
java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:346)
at $Proxy19.update(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.update(SqlSessionTemplate.java:245)
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:62)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:38)
at $Proxy83.updateFundSnapshot(Unknown Source)
------解决方案--------------------
java.lang.
ClassCastException: java.lang.Long cannot be cast to java.lang.Integer你把Long类型的定义为Integer了。看看实体类和数据库里的类型是否有差别。