java.lang.Integer can not be cast to java.lang.Long

Posted cynchanpin

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了java.lang.Integer can not be cast to java.lang.Long相关的知识,希望对你有一定的参考价值。

hibernate 查询出来的结果 id 是int类型,xml文件配置的是int, 在jython 中调用hibernate 进行查询。字段的类型是java.lang.Long,

直接将id 传进去,报java.lang.Integer can not be cast to java.lang.Long 异常。将 id 进行强转,(Long)id,传进去,正常了。

以上是关于java.lang.Integer can not be cast to java.lang.Long的主要内容,如果未能解决你的问题,请参考以下文章

解决mybatis报错Result Maps collection does not contain value for java.lang.Integer

MyBatis出错Result Maps collection does not contain value for java.lang.Integer

mybatis 报错Result Maps collection does not contain value for java.lang.Integer

javax.el.PropertyNotFoundException: Property 'id' not found on type java.lang.Integer

Could not autowire field: private java.lang.Integer com.taotao.sso.service.impl.UserServiceImpl.SSO_

required: java.lang.Integer