I'm running Hibernate 3.0.5 with Oracle 9i.
I'm hoping there's an HQL guru out there who can help me with this query.
I'm new to HQL and am running into problems converting the query below into an appropriate HQL query. I have objects generated for each of the tables involved in the query.
I'm looking for guidance on how to convert complex queries like the one listed below.
Part of my confusion is regarding how to handle the concatenation of columns into a single column using HQL.
Any help / suggestions would be greatly appreciated.
Thanks,
Quenten
Code:
SELECT
dl.worker_dn,
dl.worker_name,
dl.queue_item_status,
dl.create_date,
dl.document_review_queue_item_eid,
drq.document_review_queue_eid,
drq.queue_name,
drq.result_query,
drq.queue_descr,
d.xinstrument_no reception_no,
d.xtime_received date_filed,
ld.did, ld.multi_seq,
ld.document_type, pr.grantor, pe.grantee
, r.firstname||' '||r.lastname returnee_name,
r.street_number||' '||r.street_name||' '||r.suite||' '||r.city||' '||r.state||' '||r.zipcode||decode(r.ZIPCODE_EXT,NULL,'','-'||r.zipcode_ext) RETURNEE_ADDR
FROM ( select d1.did
,d1.xinstrument_no ,r.ddoctype
,rdi.document_review_queue_eid ,rdi.DOCUMENT_REVIEW_QUEUE_ITEM_EID,rdi.worker_dn,rdi.worker_name,
rdi.queue_item_status,rdi.create_date
from docmeta d1 , docmeta d2, revisions r,document_review_queue_item rdi
where d1.xinstrument_no = d2.xinstrument_no
and d1.did = r.did and r.dreleasestate != 'O'
and r.ddoctype <>'TD1000'
and d2.did =rdi.document_id
and rdi.document_review_queue_eid=?) dl
,document_review_queue drq
,docmeta d
,dc_opr_logical_document ld
,dc_opr_returnee r
,(select did, multi_seq,firstname||' '||lastname grantor
from dc_opr_party
where name_seq =1
and name_type= 'R' ) pr, (select did, multi_seq,firstname||' ' ||lastname grantee from dc_opr_party
where name_seq=1
and name_type= 'E' ) pe
WHERE r.did = dl.did
and pr.DID = dl.did
and pr.multi_seq = 0
and pe.did = dl.did
and pe.multi_seq = 0
and ld.did = dl.did
and d.did = dl.did
and drq.document_review_queue_eid = dl.document_review_queue_eid
and ld.multi_seq = 0
and r.return_seq =1
and drq.document_review_queue_eid = ?
order by d.xinstrument_no