关于hibernate的jion

03-09-10 neuhawk
hibernate是这样的

1,select s, ya from LessSimple s join s.yetanother ya

2,from SubMulti sm join sm.children smc where smc.name > 'a'

3,from Po po join po.list sm where sm.name > 'a'

sql server 是这样用的

1,SELECT dbo.mono.superid, dbo.monostrings.str_

FROM dbo.mono INNER JOIN

dbo.monostrings ON dbo.mono.superid = dbo.monostrings.monoid_

2,SELECT dbo.mono.superid, dbo.monostrings.str_

FROM dbo.mono LEFT OUTER JOIN

dbo.monostrings ON dbo.mono.superid = dbo.monostrings.monoid_

3,SELECT dbo.mono.superid, dbo.monostrings.str_

FROM dbo.mono RIGHT OUTER JOIN

dbo.monostrings ON dbo.mono.superid = dbo.monostrings.monoid_

4,SELECT dbo.mono.superid, dbo.monostrings.str_

FROM dbo.mono FULL OUTER JOIN

dbo.monostrings ON dbo.mono.superid = dbo.monostrings.monoid_

迷惑的地方:select s, ya from LessSimple s join s.yetanother ya

换成sql是什么样?

hibernate有没有INNER JOIN,LEFT OUTER JOIN,RIGHT OUTER JOIN

,FULL OUTER JOIN 之分。

from Po po join po.list sm where sm.name > 'a'不明白什么意思。

yehs220
2003-09-10 11:40
hibernate _有_ INNER JOIN,LEFT OUTER JOIN,RIGHT OUTER JOIN

,FULL OUTER JOIN 之分

>select s, ya from LessSimple s join s.yetanother ya<

join指的是inner join

dkhz
2003-09-10 15:30
> from Po po join po.list sm where sm.name >

> 'a'不明白什么意思。

换成sql应该是:

select po.* from po left join po_list as sm using(po_pk) where sm.name>'a'

猜你喜欢