【发布时间】:2021-01-27 01:39:10
【问题描述】:
下面是一个带有多个连接和条件的 SQL 查询,它给出了所需的输出,我想将下面的查询转换为 HQL
select * from customer c
join customer_geo_rel cg on c.id=cg.customer_id
join geography g on cg.geo_id=g.id
join geo_geo_hierarchy gghCluster on g.id = gghCluster.geo_id
join geo_geo_hierarchy gghDivision on gghCluster.geo_id = gghDivision.parent_geo_id
join role_data_rel rdr on gghCluster.geo_id = rdr.permission_data_id OR
gghDivision.parent_geo_id = rdr.permission_data_id OR
g.id=rdr.permission_data_id
【问题讨论】:
-
能否请您向我们展示您到目前为止所做的尝试?
-
到目前为止我已经做了很多选择 c.name from customer c join c.custGeoRel cg join cg.geography g join g.geographyCategory gc join g.geographyHierarchy gghCluster join gghCluster.parentGeography gghDivision join g。 roleDataRelList rdr
标签: java sql hibernate hql nativequery