浏览 1956 次
该帖已经被评为新手帖
|
|
---|---|
作者 | 正文 |
发表时间:2007-11-27
a simpe sample: Iterator it = session.createQuery("select c.id, c.name, count(o)" +" from Customer c join c.orders o group by c.id").list().iterator(); while(it.hasNext()) { Object[] pair = (Object[])it.next(); Long id = (Long)pair[0]; String name = (String)pair[1]; Integer count = (Integer)pair[2]; } 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |
发表时间:2007-11-27
Iterator<TestObj> it = session.createQuery("select new com.test.TestObj(c.id, c.name, count(o))" +" from Customer c join c.orders o group by c.id").list().iterator(); while(it.hasNext()) { TestObj obj = it.next(); } |
|
返回顶楼 | |