1

我需要在 EJBQL 中编写以下 sql 查询。

SELECT * FROM teacher t left join student_class sc on t.id_teacher = p.id_student_class where t.login = 01325 and sc.id_student_class = 3;

在类 bean Teacher 中,有如下关系:

@Column(name = "login")
private String mLogin;

@OneToMany(mappedBy = "mTeacher", fetch = FetchType.LAZY)
private List<StudentClass> mStudentClassList ;

我知道如何启动它:

SELECT mTeacher FROM Teacher mTeacher INNER JOIN mTeacher.mStudentClassList  mStudentClassList WHERE mTeacher.mLogin = 01325 AND mStudentClassList

... ???

谁能帮我?

4

0 回答 0