我需要在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
...... ???
任何人都可以帮助我吗?