-->
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.  [ 6 posts ] 
Author Message
 Post subject: PL/SQL Procedure Persistence
PostPosted: Sun Mar 28, 2004 10:24 am 
Newbie

Joined: Sun Mar 28, 2004 7:49 am
Posts: 3
Hello!

We have an application architecture where all select, insert, update and delete are made by a PL/SQL procedure. It means, for getting a lista of customers, I call a procedure Get_Customers in the database. And to update a customer I call Update_Customers.
Dows hibernate can help me in this? I mean, I would like to call session.load and have my Customer object filled, doesn't matter if it was by a procedure call or a select.
Is there any way of doing this?

Thanks,
JP


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 28, 2004 11:11 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
Try to create views and "instead of" triggers to "hide" procedures if possible.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 28, 2004 2:07 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
for hibernate 2.1.x: write a custom persister

for hibernate 2.2: more or less direct support for custom sql and stored procedure is on the roadmap.

(though, custom selects with storedproceudere is far away since the different jdbc drivers cannot agree on how to make a stored procedure/function return a result set! ;(

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 29, 2004 5:41 am 
Newbie

Joined: Sun Mar 28, 2004 7:49 am
Posts: 3
I didn't understand what baliukas mean "Try to create views and "instead of" triggers to "hide" procedures if possible". Can you, please, explain me?

About the custom persister, is it possible to write a Custom Persister only to inser, update and delete and keep using the hibernate persister for select statements?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 29, 2004 6:12 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
yes.

look at the interface - there is insert, update, delete methods you just need to handle....

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 29, 2004 6:51 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
batistellabr wrote:
I didn't understand what baliukas mean "Try to create views and "instead of" triggers to "hide" procedures if possible". Can you, please, explain me?


You can call procedure in view:

CREATE VIEW MyView AS ( SELECT * FROM mySelectProcedure() );

CREATE TRIGGER MyTrigger
INSTEAD OF INSERT ON MyView
REFERENCING NEW AS n
FOR EACH ROW
BEGIN
CALL myInsertProcedure(n);
END;


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.