inner/outer join in hibernate

hibernate目前(3.0) 只支持theta-style的外连接,标准的ANSI-style外连接暂不支持

ANSI-style的外连接是什么样子?

select template 
from CoTemplate  template left outer join CoTempField field  on template=field.comp_id.coTemplate
where  field.comp_id.coField.fieldId=7//这里field用了复合主键

目前这种写法hibernate会跑出如下异常:

org.hibernate.QueryException: outer or full join must be followed by path expression....

会抛出如上异常的还包括inner join、right join

目前hibernate能够支持的写法如下

select template 
from CoTemplate  template,CoTempField field 
where template *= field.comp_id.coTemplate
and field.comp_id.coField.fieldId=7

//*=表示左联接、=*表示右连接
好像hibnernate3目前拒绝fix this bug

参考:http://opensource.atlassian.com/projects/hibernate/browse/HHH-190

http://www.jboss.com/index.html?module=bb&op=viewtopic&t=60864&view=next

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

0X码上链

你的鼓将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值