I am developing an application in struts 2 hibernate 3.
I have 3 tables
- Inspection
- InspectionMission
- Timeline
Inspection is associated with InspectionMission and InspectionMission is associated with Timeline.
Now I have following problem. I have written following query in HQL
public List getQuartewiseInspectionList(){
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
Query q = session.createQuery(
"select count(i.inspectionId) as tot_inspections,t.year,t.quarter" +
" From Inspection as i " +
" inner join i.inspectionMission as im inner join im.timeline as t" +
" GROUP by t.year,t.quarter");
return q.list();
}
I want to fetch result as following
result[0][tot_inspections] = "6" result[0][year] = "2009"; result[0][quarter] = "Q2";
result[0][tot_inspections] = "3" result[0][year] = "2009"; result[0][quarter] = "Q3";
and so on so that I can display it in jsp struts as follows
In JSP I have written following code
evenodd">can anyone here help me in this matter.
Thanks.