1.内连接(客户和联系人)
(1)hql语句:from Customer c inner join c.setLinkedMans
Session session = SessionFactoryUtil.GetSession();
String hql = "from Customer c inner join c.linkedMans";
List list = session.createQuery(hql).list();
System.out.println(list.size());
返回的是list集合,每个都是object数组
2.迫切内连接
(1)迫切内连接和内连接的底层实现原理相同
(2)区别:使用内连接返回的是list集合,每个都是object数组,迫切内连接返回的是对象集合
(3)hql语句:from Customer c inner join fetch c.setLinkedMans
3.左外连接
(1)hql:from Customer c left outer join c.setLinkedMans
4.左外迫切连接
(1)hql:from Customer c left outer join fetch c.setLinkedMans
注意:有右外连接,没有右外迫切连接