首页 > 移动平台 > 详细

The method load(Class, Serializable) in the type HibernateTemplate is not applicable for the arguments (Class, int)

时间:2016-10-22 14:26:41      阅读:337      评论:0      收藏:0      [点我收藏+]

技术分享

引入别人的项目发现利用HibernateTemplate的load的方法报错了。错误提示为:

The method load(Class, Serializable) in the type HibernateTemplate is not applicable for the arguments (Class, int)

意思为load方法的第二个参数是实现Serializable接口的对象,int类型不符合。但jdk自动装箱,int会自转换为Integer,而Integer是实现了Serializable的,所以应该是可以的。但myeclipse偏偏报错了,原因是我的myeclipse中window->preferences->java-compiler中的Compiler compliance level设置为1.4。

解决方法是把window->preferences->java-compiler中的Compiler compliance level成1.6

或者强制转换一下。

改成

技术分享

 

The method load(Class, Serializable) in the type HibernateTemplate is not applicable for the arguments (Class, int)

原文:http://www.cnblogs.com/yoga/p/5987321.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!