Question: How do I invoke stored procedures/functions using Hibernate?
It’s possible, but not quite easy.
If you’re using Spring framework in your project, I’d strongly recommend that you have a look at Spring JDBC and consider it in place of Hibernate atleast for this specific scenario. You’ve got wonderful support there for stored procedures/functions.
Well, if you still insist on going ahead with Hibernate/you don’t want to add more complications to your project by going for Spring framework – a rare case, you can have a look at this piece of documentation which I’ve found to be very useful – http://docs.jboss.org/hibernate/core/3.3/reference/en/html/querysql.html#sp_query.