我有一個名爲LeadGeneration和Lead的JPA註釋模型類。我需要使用JPQL從上述兩個類中獲取結果集。我已經完成了我想要的結果集的SQL等價性。請告訴我如何將這個SQL轉換爲JPQL。必須將generated_employee_id和status作爲參數。將sql查詢轉換爲jpql(JPA)
SELECT *
FROM lead_generation lg, lead l
WHERE lg.lg_code = l.lead_generation AND lg.generated_employee_id = '111' AND l.status ='CONVERTED_LEAD'
AND (first_appointment_date between DATE_FORMAT(NOW() ,'%Y-%m-01') AND NOW());