Hi

I have not understand why you tell that you have 3 tables. HQL is based on core model (mapping files) not on SQL tables.

You must write the query in hql and you must use objects in your core model not id :

     select dm.id, dm.drug_name, sum(cds.qty_available)
from drug_master dm
left join cds_drugstore.drug_master cds
and cds.cds_id = 1
and cds.source_id = 'sourceName'
and cds.source_type = 'c'
group by dm.id