How to call Oracle Function or Procedure using Hibernate (EntityManager) or JPA

前端 未结 6 923
小蘑菇
小蘑菇 2020-11-28 09:36

I have an Oracle function which return sys-refcursor and when I call this function using Hibernate, I am getting the following exception.

Hibernate: { ? = ca         


        
6条回答
  •  萌比男神i
    2020-11-28 10:06

    The previous solution doesn´t seem to work with eclipselink. I got this running with native queries under JPA with

                List result = em.createNativeQuery("select YOURFUNCTION(?) from dual ")
                          .setParameter(1, ONEPARAMETER)
                          .getResultList();
    

提交回复
热议问题