This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
select tmrhdr.tmr_id,tmr_NAME,tmrlog.id,tmrlog.tmr_type from tmr_hdr tmrhdr
left join tmr_log tmrlog on tmrhdr.tmr_id = tmrlog.tmr_id and tmrlog.tmr_type = 'TimeSheet'
where tmr_user ='golden'
i want to write the same query in HQL. i try to write query.
select tmrhdr,tmrhdr.tmrId,tmrhdr.tmrName,tmrlog.id,tmrlog.tmrType from TmrHdr as tmrhdr
left join TmrLog as tmrlog where tmrhdr.tmrId = tmrlog.tmrHdr.tmrId and tmrlog.tmrType = 'TimeSheet'
where tmrhdr.user ='golden'
but result of HQL and sql query is different.
HQL query not take the all record of TmrHdr table . instead it will fire the query like inner join.