select tc.tck_class_name, DATE_FORMAT( ts.tck_src_date,'%Y-%m'),COUNT(ts.tck_serial)
from TicketSell ts ,TicketClass tc
where ts.tck_class_id = tc.tck_class_id
and DATE_FORMAT(ts.tck_src_date,'%Y-%m') in (?,?,?)
and ts.tck_status <> 3
and ts.tck_class_id = ?
GROUP BY DATE_FORMAT(tck_src_date,'%m')
通过上面的hql语句,调用list = this.getHibernateTemplate().find(queryString, values);这个方法,查询我想要的三个结果值,然后返回的list值中,因为返回的不是对象,那么我怎么样能够获取我想要的值呢
------解决方案--------------------
- Java code
for(Object o : list){ Object[] obj = (Object[])o; TicketSell ts= (TicketSell)obj[0]; TicketClass tc=(TicketClass)obj[1]; int tsid=ts.getId(); int tcId= tc.getId(); }