java - Mistake in HQL query while creating reports through hibernate projection -
i had following query working fine had convert hibernate projection performance issues. namedquery = " select o orderjob o " was converted to:- string hqlquery = "select " + "new jobauditlistvo( o.jobdate, o.jobtype, customer.name, job.street, payment.description, p.paid,o.invoice) " + " orderjob o " + " join o.order ordr " + " join ordr.customer customer " + " join o.jobaddress job " + " join o.payment p" + " join p.paymentreceivedmethod payment"; getentitymanager().createquery(hqlquery).getresultlist(); but list returning 0 results. while name query return 2 results. i have got answer. both queries absolutely equivalent. problem had use left join instead of simple join. because entities returning null.