当前位置: 代码迷 >> Java Web开发 >> 关于左外连接的问题
  详细解决方案

关于左外连接的问题

热度:136   发布时间:2007-03-05 23:32:00.0
关于左外连接的问题

--------->我在配置文件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

??????????????????为什么??????????????????????


----------------解决方案--------------------------------------------------------
鼎鼎
----------------解决方案--------------------------------------------------------
  相关解决方案