String hql = "select l.areaid,count(l) from Link l group by l.areaid"; Session s = SessionFactoryUtils.getNewSession(getSessionFactory(), getEntityInterceptor()); list = s.createQuery(hql).list(); Object[] object = list.toArray();