Monday, January 4, 2016

How can we invoke stored procedures in hibernate?

Ref:- http://career.guru99.com/hibernate-interview-questions/

In hibernate we can execute stored procedures using code as below:
[xml]
<sql-query name=”getStudents” callable=”true”>
<return alias=”st” class=”Student”>
<return-property name=”std_id” column=”STD_ID”/>
<return-property name=”s_name” column=”STD_NAME”/>
<return-property name=”s_dept” column=”STD_DEPARTMENT”/>
{ ? = call selectStudents() }
</return>
</sql-query>
[/xml]

No comments:

Post a Comment