Asked on October 24, 2013
Hi All ,
can call the stored procedures by using hibernate?, if yes please let me know how can we call the stored procedures in the hibernate .
Replied on October 24, 2013
Suppose you have a procedure as
CREATE PROCEDURE 'student' (int_college_id int(50))
SELECT * FROM colleges WHERE college_id = int_college_id;
Then you can use createSQLQuery to call your procedure.
Query query = session.createSQLQuery("call student(:collegeId)")