-->
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.  [ 5 posts ] 
Author Message
 Post subject: Help please!!!!
PostPosted: Thu Mar 17, 2005 11:21 am 
Newbie

Joined: Tue Mar 15, 2005 10:40 am
Posts: 5
Hello!!!

Please give me a direction!!

I have to run an Oracle stored procedure for doing a patient de-duplication. The procedure has as many as 18 joins. Once the procedure is called, I need to display all the results on a JSP page. Finding problems to read the result set from a stored procedure.

I have been reading the "Hibernate in Action". I could not find much information regarding the "READ" from a stored procedure.
I need to provide the POC for the OUT parameters for the stored proc.
Updating, creating and deletion was possible with the stored procs.

Thanks a lot.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 12:43 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
stored procedure read support is only in cvs yet and very experimental. You can always use plain JDBC through session.connection()


Top
 Profile  
 
 Post subject: Clarification
PostPosted: Thu Mar 17, 2005 12:59 pm 
Newbie

Joined: Tue Mar 15, 2005 10:40 am
Posts: 5
Thanks for the update Micheal.

Pl take a minute to see one of my stored proc.

create or replace procedure testresults_report
(p_condition health_related_activity.condition_code%type, --input parameter
p_report_status health_related_activity.hra_status%type, --input parameter
p_completed_start_date disease_report.date_started%type, --input parameter
p_completed_end_date disease_report.date_completed%type, --input parameter
p_community_area postal_location.community_area_code, --input parameter
p_priority health_related_activity.priority_level, --input parameter
p_age person.age%type, --input parameter
p_refcur in out sys_refcursor) --output parameter (result set)

is
v_stmt varchar2(2000) := select hra.hra_id, en.given_name, phe.entity_id, pe.birth_date,
hra.condition_code, pl.community_area_code, en.entity_id, hra.priority_level,
dr.date_completed, dr.date_started, (select ien.last_name||', '||ien.given_name
from health_related_activity iact, activity_relationship ar,
public_health_entity iphe, entity_name ien, entity_hra_participation iehp
where iact.hra_id = ar.hra_id1
and ar.hra_id2 = hra.hra_id
and ar.act_rel_type_code = 'PERTAINS'
and iact.hra_id = iehp.hra_id
and iehp.part_type_code = 'INVESTIGATOR'
and iehp.entity_id = iphe.entity_id
and iphe.entity_id = ien.entity_id ) assigned_to_name,
row_number() over (order by phe.entity_id) cnt,
dense_rank() over (order by phe.entity_id) rnk
from health_related_activity hra, disease_report dr, postal_location pl,
public_health_entity phe, person pe, entity_name en,
entity_hra_participation ehp,
public_health_entity phe2, entity_name auth, entity_hra_participation ehp2,
public_health_entity phe3, entity_name org, entity_role er
where dr.hra_id = hra.hra_id
and hra.hra_id = ehp.hra_id
and ehp.entity_id = phe.entity_id
and ehp.part_type_code = 'SUBJECT'
and phe.entity_id = pl.entity_id
and en.entity_id = phe.entity_id
and phe.entity_id = pe.entity_id
and ehp.hra_id = ehp2.hra_id
and ehp2.entity_id = phe2.entity_id
and ehp2.part_type_code = 'AUTHOR'
and auth.entity_id = phe2.entity_id
and phe2.entity_id = er.entity_id1
and er.entity_id2 = phe3.entity_id
and er.role_class_code = 'EMPLOYEE'
and phe3.entity_id = org.entity_id

This is just one of the reports, we have. To do this as a plain JDBC, it would be very tuff. Would you have an idea, as when this read support can be released.

Thanks a lot!!!!!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 5:36 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
in hibernate3 you will be able to do this soon - but the stored procedure must return the resultset - not just via a output parameter.

see http://opensource.atlassian.com/project ... se/HHH-238 for the hopefully soon to be integrated patch.

-max

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 7:09 pm 
Newbie

Joined: Tue Mar 15, 2005 10:40 am
Posts: 5
Thanks a lot MAX.
I guess this would be a great help for the Hibernate developers.
Nice to know that the patch is released today. eventually it would evolve and be as efficient as the other parts of Hibernate. Shall try working on it.

Great job and thanks for all the help.


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

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.