This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Calling stored procedures from hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Calling stored procedures from hibernate" Watch "Calling stored procedures from hibernate" New topic

Calling stored procedures from hibernate

Raj Kumar Bindal
Ranch Hand

Joined: Apr 15, 2006
Posts: 418
Can we call any type of stored procedure from hibernate(e.g. calling stored procedure returning multiple values etc)?

Is it something that only stored procedures returning sys_refcursor can be called from hibernate?
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

So long as a stored procedure returns a result set as the first out parameter you can call it from Hibernate. See the documentationfor an example.

One thing worth thinking about is why you might want to call a stored procedure from Hibernate. Unless it is because you have no choice its not something I'd choose to do.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
I agree. Here's the link:
subject: Calling stored procedures from hibernate
It's not a secret anymore!