File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes implementing stored procedure in hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "implementing stored procedure in hibernate" Watch "implementing stored procedure in hibernate" New topic
Author

implementing stored procedure in hibernate

Al McCoy
Greenhorn

Joined: Nov 19, 2007
Posts: 3
Most of the examples posted in this forum and on the hibernate website cover cases where the procedure returns a ref cursor.

1. Could someone point me to examples of using hibernate where the procedure simply return an out parameter which is not a ref cursor but some other types (E.g NUMBER, VARCHAR) ?

2. I believe Hibernate has restrictions on the number of out parameter that can be specified. What is the optimal workaround for such a situation.

Thanks

A R M
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17260
    
    6

Yep you are right because Hibernate has restrictions, which is based on Oracle's JDBC driver not implementing to the spec/standard. (Sorry Michael, not directed at you there )

In order to work with Stored Procedures here are the rules

1. You can only have one out parameter
2. That out parameter must be the first parameter
3. That out parameter must be a ref-cursor.

Say you want to call a stored procedure that does not follow those rules, well then you would have to use a SQLQuery object and call the stored procedure is a different manner like in Oracle you can call "select myProcedure(param1, param2) from dual"

Mark

Have fun.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
Consider Paul's rocket mass heater.
 
subject: implementing stored procedure in hibernate