Sunday, 14 April 2019

How Can We Invoke Stored Procedures In Hibernate?


In hibernate we can execute stored procedures using code as below:
  1. [xml]  
  2.   
  3. <sql-query name=”getStudents” callable=”true”>  
  4.   
  5. <return alias=”st” class=”Student”>  
  6.   
  7. <return-property name=”std_id” column=”STD_ID”/>  
  8.   
  9. <return-property name=”s_name” column=”STD_NAME”/>  
  10.   
  11. <return-property name=”s_dept” column=”STD_DEPARTMENT”/>  
  12.   
  13. { ? = call selectStudents() }  
  14.   
  15. </return>  
  16.   
  17. </sql-query>  
  18.   
  19. [/xml]  

No comments:

Post a Comment

Spring Boot @ConfigurationProperties and Properties File

 In this tutorial, you will learn to use @ConfigurationProperties to map properties files to POJO classes in Spring Boot application. Let’s ...