出现这个异常的原因是因为Hibernate3.2.5版本的(select count(*))查询返回的结果是个Long 不能强制转换

 

解决方法:

方法1:借用String进行转换

方法2:用hashcode()

 

更多推荐