First, the simplest is a one-to-many connection, such as:
Select student from Teacher t join t.students student where student ....
What if it's many to one? There are implicit and explicit differences (the one-to-many scenario above is implicit). Can be like this
Select student from student student where student.teacher.age>30
This is implicit, and hibernate automatically connects to the teacher table. You can also display a connection like this:
Select student from Student studentleft outer join Student.teacher T where t.age>30
It is clear here that the left outer join is used when connecting the teacher table. It's easy to ignore outer here, if it's written like this:
Select student from student studentleft join Student.teacher T where t.age>30
This is the wrong wording, and hibernate will not recognize the conditions of t.age.
Left OUTER join in Hibernate