Hello,
Im workign on a HQL statement, where the working sql looks like:
Code:
SELECT DISTINCT(st.statusid) ,
st.fileid ,
st.refcd ,
st.eventdate ,
codeLevel2.description,
codeLevel3.description,
codeLevel4.description,
st.provider ,
st.partial ,
st.totgw ,
st.totgwu ,
st.totpiece ,
st.activefl ,
st.fromcd ,
st.tocd ,
st.vessel ,
st.message1 ,
st.message2 ,
st.insertuser
FROM ptcof_status as st ,
gbd_statuscode as codeLevel1,
OUTER gbd_statuscode as codeLevel2,
OUTER gbd_statuscode as codeLevel3,
OUTER gbd_statuscode as codeLevel4
WHERE codeLevel1.statuslevel=1
AND codeLevel2.statuslevel=2
AND codeLevel3.statuslevel=3
AND codeLevel4.statuslevel=4
AND codeLevel2.code =st.level2
AND codeLevel3.code =st.level3
AND codeLevel4.code =st.level4
AND st.refcd ='PEN582704'
AND st.fileid ='8885241'
ORDER BY st.eventdate
I mapped the two different tables ptcof_status and gbd_statuscode where ptcof_status is the main table and the gbd_statuscode is just a helping table to find out some labels for values.
I checked the hibernate documentation but it only shows joins on fields which exist with the same name on both tables (usually pk/fk's) which isnt the case in my example...
any ideas how i could solve the outer join issue?