I am new at Hibernate, and I have a question regarding HQL Left join.
I try to left join 2 tables, patient and provider, and keep getting \"Path expected for join!\"
Your patient has a reference to the provider, and also has the provider id as a property. I would probably get rid of the provider id property on the patient and just have the reference to the provider. Then your query should be something like this.
select pat.patientId, pat.patientName
from patient as pat
left join pat.provider as pro
To join, you need the association path from your patient to your provider, which in this case is pat.provider. Then hibernate will automatically use the "column" specified in the many-to-one mapping to join into the provider table. In your case, the join doesn't make a lot of sense since you aren't querying on any properties of the provider, so something like this might make more sense
select pat
from patient as pat
join pat.provider as pro
where pat.patientName = 'John'
and pro.name = 'United Healthcare'
There you are able to filter your patient list to patients named John that have United Healthcare as the provider.