I need to do a join query from 3 table Professor , teacher and students. Each professor has a list of teachers and each teacher has a list of student. I am working on a web service which will give me only the professor id and base on that I need to get all the students for this particular professor. So I will need to get list of teachers first ,then from that I can get all students. Anyone can help on this? I don't want to use cascade select. I want to use JOIN FETCH because I'm using jpa.
Table Professor: Professor id , Prof name , Prof address
Table Teacher : Teacher id , Professor id, Teacher name
Table student : Student id, Teacher id, Student name, Student address