私は同じ問題を抱えていました..私はこのクエリを書きました
Query sqlquery = session.createQuery("select c.courseName,f.facultyID,f.facultyName,f.facultyEmailID,f.facultyContactNo,s.subjectName from com.bean.CourseBean as c,com.bean.FacultyBean as f,com.bean.Faculty_SubjectBean as fs,com.bean.SubjectBean as s where f.facultyID=fs.facultyBean.facultyID AND s.subjectID=fs.subjectBean.subjectID AND c.courseID=f.courseBean.courseID AND collegeid=1");
オブジェクトのリストを返し、サーブレットで書いた、
java.util.List objList= objFacultyService.listFaculty_sql(1);
java.util.List<Temp> objtemp = new ArrayList<Temp>() ;
for (Object[] objects : objList)
{
Temp temp = new Temp();
temp.setFacultyEmailID(objects[3].toString());
temp.setCourseName(objects[0].toString());
if(objects[4]==null)
{
temp.setFacultyContactNo(1);
}
else
{
temp.setFacultyContactNo(Long.parseLong(objects[4].toString()));
}
temp.setFacultyID(Long.parseLong(objects[1].toString()));
temp.setFacultyName(objects[2].toString());
temp.setSubjectName(objects[5].toString());
objtemp.add(temp);
}