How to do a complex LEFT JOIN condition in JPQL?

前端 未结 1 718
孤街浪徒
孤街浪徒 2021-01-14 21:15

I am using JPQL for the model queries from Play Framework.

I wonder if JPQL supports \"complex\" ON condition for LEFT JOIN.

In an example I have, there are

1条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-14 22:15

    JPQL, AFAIK, doesn't support ON clauses, but HQL does support them. The chose to use the with keyword though:

    select a from App a 
    left join a.history h with h.fromDate = :fromDate
    where h.fromDate is null
    

    0 讨论(0)
提交回复
热议问题