这是一个SQL :
select * from userinfo a left join (
select b.* from userinfo a left outer join usergroupinfo b on a.oid=b.userinfooid where b.groupoid=1) b on a.oid = b.userinfooid
我把上述SQL 转化为HQL:
from com.kmi.expert.model.Userinfo as u left outer join (select b from com.kmi.expert.model.Userinfo a left outer join a.Usergroupinfos b where b.groupoid=1) as ug
执行就是不正确,假设所有的配置关系都正确,所有的客观环境都没有问题,要将上面的SQL转化为HQL应当如何写。执行的结果也一样.麻请达人告知.
select * from userinfo a left join (
select b.* from userinfo a left outer join usergroupinfo b on a.oid=b.userinfooid where b.groupoid=1) b on a.oid = b.userinfooid
我把上述SQL 转化为HQL:
from com.kmi.expert.model.Userinfo as u left outer join (select b from com.kmi.expert.model.Userinfo a left outer join a.Usergroupinfos b where b.groupoid=1) as ug
执行就是不正确,假设所有的配置关系都正确,所有的客观环境都没有问题,要将上面的SQL转化为HQL应当如何写。执行的结果也一样.麻请达人告知.