------解决方案-------------------- 主要是用连接操作,左右外链,内联。例如:学员—班级
Select c.name , s.name from Student s inner join s.classes c
外联(左、右外联)
班级—学员
Select c.name, s.name from Classes c left join c.students s
Select c.name, s.name from Classes c right join c.students s
然后用:createQuery(sql语句)就行了 ------解决方案--------------------