学生表 对应 Student 类
Student{
Integer id;
Set scores; // 所有该学生下的成绩集合
}
成绩表 对应 Score 类
Score{
Integer id;
Integer value; // 成绩的值
Student student; // 该成绩属于哪个学生
}
当需要查询学生,又需要对学生的某科成绩进行排序的话可以这样
select stu from Student as stu
left join stu.scores as sc
with sc.id=1
where ....
order by sc.value
3380



被折叠的 条评论
为什么被折叠?



