This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills: The software developer's life manual and have John Sonmez on-line!
See this thread for details.
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

implementing stored procedure in hibernate

 
Al McCoy
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic