开发者

How to write subquery in hibernate

i have SQL query , i don't know how to write in hibernate

select lp.lnprdtname,la.lid,la.step 
from mfic.lnapp as la 
left join mfic.lnprdt as lp on lp.lnprdtid in 
    (select lnprdtid from mfic.lnapp where lid in 
        (select lid from mfic.lnbrwr where brwrid in 
            (select brwrid from mfic.brwr where uid=1)))
where la.lid in 
    (select li开发者_JAVA百科d from mfic.lnbrwr where brwrid in 
        (select brwrid from mfic.brwr where uid=1));


As said here: Chapter 14. HQL: The Hibernate Query Language - 14.13. Subqueries

from DomesticCat as cat
where cat.name not in (
    select name.nickName from Name as name
)

Note that HQL subqueries can occur only in the select or where clauses.

Anyway, I'm not sure it's a good idea to concat so many subqueries in a single statement...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜