Java Mailing List Archive

http://www.gg3721.com/

Home » Hibernate Dev List »

[hibernate-dev] Hibernate join problem

sylvain mouquet

2008-07-13


Author LoginPost Reply
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



_______________________________________________
hibernate-dev mailing list
hibernate-dev@(protected)
https://lists.jboss.org/mailman/listinfo/hibernate-dev
©2008 gg3721.com - Jax Systems, LLC, U.S.A.