标签:hibernate return public count users
在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(); }
本文出自 “东方小阁” 博客,请务必保留此出处http://lailai.blog.51cto.com/3362373/1559034
hibernate HQL查询结果query.list.get(0)
标签:hibernate return public count users
原文地址:http://lailai.blog.51cto.com/3362373/1559034