File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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!