hql返回数值

1 public int getCountUser() throws ParseException {
2         Session hSession = sessionFactory.getCurrentSession();
3         Query query = hSession.createQuery("select count(*) from WgUserinfoEntity");
4         return ((Number)query.uniqueResult()).intValue();
5     }

 

posted @ 2017-02-22 17:15  sunnyny  阅读(486)  评论(0编辑  收藏  举报