Java DAO create query please help
I am not sure whether i posted this thread at the right place. Anyway my problem at below
Code:
public class Student()
private String name;
private String id;
private int marks;
private Date issueOn;
......
......
}
public class StudentDaoImpl extends HibernateDaoSupport implements StudentnDao{
public ArrayList<Student> getSumMarkl(String dayStart, String dayEnd)throws DataAccessException{
Session session = this.getSession();
ArrayList<Student> stdList = new ArrayList<Student>();
try{
Query query = session.createQuery("select s.name, s.id, SUM(ms.marks)
from Student s
where TO_CHAR(TRUNC(s.issueOn),'YYYYMMDD')
between '"+dayStart+"' AND '"+dayEnd+"'
GROUP BY s.name, s.id
ORDER BY ms.id ASC");
.....................................................
System.out.println("List size: " + query.list().size());
................................................
// the list contains value
//how do i get the result into my ArrayList?
...................................................
.............................................
}