Join fetch is actually equivalent to the connection part in the database. The default value is inner join. Left outer join is also supported. Join fetch is mainly used in HQL. It is mainly reflected in one-to-many and many-to-many Relational Tables, such as class Student {private int id; private int name; private Team team; get {...}; Set {...};} Class Team {private int tid; private String name; private Set <Student> students; get {...}; Set {...} ';} By default, fetch = lazy is used to query all Student in the Team. ---------------- query --------------------- Team t = (Team) session. load (Team. class, 3); Set <Student> sets = t. getStudents (); for (Student s: sets) {System. out. println (s. getId () + "" + s. getName ();} ---------------- query result ----------------- Hibernate: select team0 _. cid as cid0_0 _, team0 _. name as name0_0 _ from team0 _ where team0 _. cid =? Hibernate: select students0 _. cid as cid0_1 _, students0 _. id as id1 _, students0 _. id as id1_0 _, students0 _. cid as cid1_0 _, students0 _. name as name1_0 _ from Student students0 _ where students0 _. cid =? --------------------------------------- The query is performed twice. The first query is performed on the specified Team, and the second query is performed on all Student under the specified Team. Join fetch is used to reduce the number of queries. ---------------- Query --------------------- List <Class> lists = session. createQuery ("from Team t join fetch c. students order by t. cid "). list (); for (Team t: lists) {System. out. println (t. getCid () + "" + t. getName () + ""); for (Student s: t. getStudents () {System. out. println ("" + s. getId () + "" + s. getName () + "" + s. getTeam (). getCid () ;}------------------ query result ----------------- Hibernate: select team0 _. cid as cid0_0 _, students1 _. id as id1_1 _, team0 _. name as name0_0 _, students1 _. cid as cid1_1 _, students1 _. name as name1_1 _, students1 _. cid as cid0_0 __, students1 _. id as id0 _ from team class0 _ inner join Student students1 _ on team0 _. cid = students1 _. cid order by team0 _. cid -----------------------------------------