[hibernate-dev] Hibernate join problem

sylvain mouquet flashman22 at gmail.com
Sun Jul 13 06:20:36 EDT 2008


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-dev/attachments/20080713/bc5c5c6c/attachment.html 


More information about the hibernate-dev mailing list