How can we call a stored procedure with Hibernate and JPA?

后端 未结 7 1379
时光取名叫无心
时光取名叫无心 2020-12-15 06:34

How can we call a stored procedure using Hibernate or JPA?

7条回答
  •  情深已故
    2020-12-15 07:13

    To execute remote procedure use this construction:

    Mapping

       
        {call some_rp(:param1, :param2)}
    
    

    Java code

    session.getNamedQuery("RP").setInteger("param1", 1).setInteger("param2", 2).executeUpdate();
    

提交回复
热议问题