-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: using outer joins with Hibernate 3
PostPosted: Tue Aug 30, 2005 11:55 am 
Newbie

Joined: Mon May 03, 2004 11:53 pm
Posts: 7
The following TOAD query works with the ansi outer joins but I'm having trouble implementing it in Hibernate 3 HQL. Can you provide any suggestions ?

select tc.*
, sd.*
from table_tc tc
left outer join table_td td on td.table_td_ky = tc.table_td_ky
left outer join table_tc loadtc
on loadtc.table_td_Ky = td.table_td_ky
and loadtc.catg_cd = 'ORIG '
and loadtc.clsf_cd = 'XXX '
and loadtc.task_cd = 'LOAD '
left outer join table_sd sd
on sd.whse_Ky = loadtc.TRAN_ky
and sd.whse_typ_cd = 'TCTL '
where tc.table_td_ky = td.table_td_ky
and tc.task_cd = 'RLSE '
and tc.cvt_stat_cd = 'C2SPN'
and tc.status_cd = 'RLPND'


The following HQL works as though using joins not outer joins:

<query name="tctl.tec">
<![CDATA[
select tc, loadsd
from tc tc left outer join tc.td
, tc loadtc
, sd sd
where tc.statusCd = ?
and tc.cvtStatCd = ?
and tc.taskCd = ?
and loadtc.td.tdKy = tc.td.tdKy
and loadtc.categoryCd = 'ORIG '
and loadtc.classificationCd = 'XXX '
and loadtc.taskCd = 'LOAD '
and sd.whseKy = loadtc.tranKy
and sd.whseTypCd = 'TCTL '
order by tc.stdId, tc.verId, tc.docId
]]>
</query>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.