HQL :
FROM FileCheckOrg as fco right outer join fco.org as o WITH o.semesterId =? where fco.type=?
生成sql如下:
select filechecko0_.id as id6_0_, org1_.id as id10_1_, filechecko0_.title as title6_0_, filechecko0_.author_id as author3_6_0_, filechecko0_.author_name as author4_6_0_, filechecko0_.click_count as click5_6_0_, filechecko0_.state as state6_0_, filechecko0_.type as type6_0_, filechecko0_.create_time as create8_6_0_, filechecko0_.file_id as file9_6_0_, filechecko0_.org_id as org10_6_0_, org1_.clazz_id as clazz2_10_1_, org1_.clazz_name as clazz3_10_1_, org1_.grade_id as grade4_10_1_, org1_.grade_name as grade5_10_1_, org1_.semester_id as semester6_10_1_, org1_.semester_name as semester7_10_1_, org1_.create_time as create8_10_1_ from tb_kms_file_check_org filechecko0_ right outer join tb_kms_org org1_ on filechecko0_.org_id=org1_.id and ( org1_.semester_id=? ) where filechecko0_.type=? limit ?
希望能把条件加在on后面,WITH 只能有一个条件,多条件是会报错,错误如下:
with-clause referenced two different from-clause elements
selectfilechecko0_.*
fromtb_kms_file_check_orgfilechecko0_
rightouterjoin(selectorg1_.*
fromtb_kms_orgorg1_
whereorg1_.semester_id=?)rgt
onfilechecko0_.org_id=rgt.id
wherefilechecko0_.type=?limit?
链接查询语法是
SELECT*FROM表1 INNERJOIN表2ON表1.字段号=表2.字段号版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。