Calling a Stored Procedure in Hibernate

后端 未结 2 396
时光说笑
时光说笑 2020-12-10 22:02

I just started learning hibernate last night and its rather fun. I am some trouble calling a stored procedure as a sql-query with hibernate. I have attached the source and t

2条回答
  •  鱼传尺愫
    2020-12-10 22:33

    According to the documentation, the procedure must return a result set and should be called like this:

    { ? = call procedureName() }
    

    So try the following instead:

    
      
        
        
      
      { ? = call getRecords }
    
    

    References

    • Hibernate Core Reference Guide
      • 16.2.2. Using stored procedures for querying

提交回复
热议问题