Home  >  Forum  >  Hibernate
Post New Query

Stored Procedure


joined on
October 24,2013
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 .

Thanks

Lokee yadav


 

joined on
October 10,2013
Replied on October 24,2013

Suppose you have a procedure as


CREATE PROCEDURE  'student'  (int_college_id int(50))
BEGIN
   SELECT * FROM colleges WHERE college_id = int_college_id;
END 

Then you can use createSQLQuery to call your procedure.

Query query = session.createSQLQuery("call student(:collegeId)")
.addEntity(Colleges.class).setParameter("collegeId", "100");

Write Answer









Copyright ©2017 concretepage.com, all rights reserved |Privacy Policy | Contact Us