--------->我在配置文件Set里用了outer-join=“true”
ArrayList customerfind=((org.hibernate.classic.Session) session).find("from Customer as c");
Customer customerget=(Customer) session.get(Customer.class,new Integer(1));
System.out.println(customerget.toString());
=================执行结果====================
Hibernate:
select
customer0_.id as id0_,
customer0_.name as name0_,
customer0_.home_city as home3_0_,
customer0_.home_street as home4_0_,
customer0_.com_city as com5_0_,
customer0_.com_street as com6_0_
from
customer customer0_
Hibernate:
select
zhiwei0_.customer_id as customer3_1_,
zhiwei0_.id as id1_,
zhiwei0_.id as id1_0_,
zhiwei0_.zhiwei_name as zhiwei2_1_0_,
zhiwei0_.customer_id as customer3_1_0_
from
zhiwei zhiwei0_
where
zhiwei0_.customer_id in (
?, ?, ?
)
1,TOM,shanghai,tonghe.road,shanghai,biejin.road,employee,manager
================================如果要是这么写================================
<<<<<<<第一行给去了>>>>>>>>>>>
Customer customerget=(Customer) session.get(Customer.class,new Integer(1));
System.out.println(customerget.toString());
=================执行结果====================
Hibernate:
select
customer0_.id as id0_1_,
customer0_.name as name0_1_,
customer0_.home_city as home3_0_1_,
customer0_.home_street as home4_0_1_,
customer0_.com_city as com5_0_1_,
customer0_.com_street as com6_0_1_,
zhiwei1_.customer_id as customer3_3_,
zhiwei1_.id as id3_,
zhiwei1_.id as id1_0_,
zhiwei1_.zhiwei_name as zhiwei2_1_0_,
zhiwei1_.customer_id as customer3_1_0_
from
customer customer0_
left outer join
zhiwei zhiwei1_
on customer0_.id=zhiwei1_.customer_id
where
customer0_.id=?
1,TOM,shanghai,tonghe.road,shanghai,biejin.road,employee,manager
??????????????????为什么??????????????????????
----------------解决方案--------------------------------------------------------
鼎鼎
----------------解决方案--------------------------------------------------------