在Hibernate2.0之前版本list.get(0)返回的是Integer类型.
但是在Hibernate3.0以后版本list.get(0)返回的是Long类型.
public Integer getUsersCount() { String hql = "select count(*) from Users"; List list = super.pageQuery(hql); Number num = (Number) list.get(0); return num.intValue(); }
时间: 2024-10-01 06:03:23