1 List students =session.createQuery("select c.name, count(s) from Student s join s.classes c " +
2 "group by c.name order by c.name").list();
3 for (Iterator iter=students.iterator(); iter.hasNext();) {
4 Object[] obj = (Object[])iter.next();
5 System.out.println(obj[0] + ", " + obj[1]);
6 }
posted on 2009-03-05 22:43
simplye 阅读(869)
评论(0) 编辑 收藏 所属分类:
hibernate note