-->
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: Oracle - Hibernate - Packages / Stored Procedures
PostPosted: Thu Dec 18, 2014 3:51 pm 
Newbie

Joined: Thu Dec 18, 2014 3:29 pm
Posts: 1
Dear All,

This is the first time I am even looking at Hibernate o please bare with me.

So I have been reading through the docs concerning Packages/Sp's ( essentially the same things ) and I am a bit confused.

So the Database is read only as far as general users are concerned, and all record updates are done via packages. The packages are run using the creator permission and users access through the execute permission. A typical insert method for a table looks like:

PROCEDURE ins(
p_DEMAND_PROF_ID IN DEMANDS.DEMAND_PROF_ID%type ,
P_FLOW IN DEMANDS.FLOW%TYPE ,
p_ID out DEMANDS.ID%type ,
P_DEMAND_ORDER IN DEMANDS.DEMAND_ORDER%TYPE ,
P_VEH_TYPE_ID IN DEMANDS.VEH_TYPE_ID%TYPE ,
V_RESULT OUT NUMBER
);

The procedure does not return a record sets, but it does return:

The new ID assigned to the row ( P_ID ) and a result code ( v_result )

The ID is of coursed returned via a sequence for the table in question.

So the documentation speaks about the first parameter required to a REF_CUSOR but I would assume that would be for an SP that would return a record set.

In this instance the package is being called to perform the insert ( the package also does a few other tasks related to this ) or an update or a delete ( in some instances a delete is not really a delete it simply flips a column called in_use from 1 to 0 ).

So I am fine with using hibernate in it's classic ORM gathering of data to populate objects, performing its own query construction, and all those things that hibernate does really well. But in this database there are a lot of things that happen behind the scenes in these packages that would have to be completely re-engineered ( 1000's of man hours ) into java that really make no sense in the application layer.

So my question is ultimately can hibernate co-exist with this design process, call SP like the on I mentioned?

I don't want to get into a philosophic discussion about what should be done where because there are 937,459,384,854 ways to do a thing. what I want to do is determine if I can use the best of both the oracle pl/sql stack AND Hibernate stack to make a smooth running system.

Thanks in advance and I hope everyone has a great holiday.

- FG


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.