似乎知道理由了。
/////////////////////////////////////////////////////////////////////
PostPosted: Wed Jan 10, 2007 9:08 pm    Post subject:   Reply with quote 
Well from what I have investigated the only way to use an outer join is using a path. There is no way with Hibernate to do:
select *
from tablea a left outer jin tableb b on a.col1 = b.col2
without using an existing one-to-many or many-to-many mapping
//////////////////////////////////////////////////////////////////////
PostPosted: Thu Jan 11, 2007 4:10 pm    Post subject: Are you sure...?  Reply with quote 
Hi, same problem here. I cannot belive that this is not possible.
The join ... on syntax should be supported, shouldn't it?
thanks
///////////////////////////////////////////////////////////////////////
PostPosted: Mon Jan 22, 2007 8:05 am    Post subject:   Reply with quote 
Hi, same problem. Is this a missing functionality, or is this normal in Hibernate programming model? If this is normal, than what should we do to solve this problem?
Thanks.
///////////////////////////////////////////////////////////////////////
PostPosted: Wed Jun 06, 2007 11:10 am    Post subject: I think I have a solution   Reply with quote 
This kind of join can be done in Hibernate using "theta-style" joins (the old way to join).
For example - instead of:
select *
from tablea a left outer jin tableb b on a.col1 = b.col2
Use this syntax:
from tablea a, tableb b
where a.col1 = b.col2
Each row in the result would be an Object array with 2 elements, the first would be tablea (the corresponding object), the second would be tableb.
You can also use this syntax so that each row will be a map:
select new map(a as ta, b as tb) from tablea a, tableb b ...
Now each row will be a map:
{ta=tablea object, tb=tableb object} 这是从hibernate官方网站上看到的,似乎是hibernate本身的问题,不具有此功能,难怪在中文网页上都没有知道,那似乎使用这个连接语句的人就很少了。