Hi,
I am using Hibernate 4.3.11 version with JPA implementation to invoke a stored procedure which has OUT paratemer of type SYS_REFCURSOR.
Below is the piced of cide I have written in JPA
@NamedStoredProcedureQuery(name = "ADMIN_TAX_CALC", procedureName = "admintax_pr", parameters = { @StoredProcedureParameter(mode = ParameterMode.REF_CURSOR, type = void.class, name = "outValue"), @StoredProcedureParameter(mode = ParameterMode.IN, type = String.class, name = "policyNbr"), @StoredProcedureParameter(mode = ParameterMode.IN, type = String.class, name = "repCat1"), @StoredProcedureParameter(mode = ParameterMode.IN, type = String.class, name = "repCat2"), @StoredProcedureParameter(mode = ParameterMode.IN, type = String.class, name = "repCat3"), @StoredProcedureParameter(mode = ParameterMode.IN, type = String.class, name = "repCat4"), @StoredProcedureParameter(mode = ParameterMode.IN, type = String.class, name = "repCat5"), } )
entityManager = getEntityManager(); StoredProcedureQuery query = entityManager.createNamedStoredProcedureQuery("ADMIN_TAX_CALC"); query.setParameter("policyNbr", "xxxxx"); query.setParameter("repCat1", "xxxx"); query.setParameter("repCat2", "xx"); query.setParameter("repCat3", ""); query.setParameter("repCat4", ""); query.setParameter("repCat5", ""); query.getResultList();
But this sis returning error " R java.lang.UnsupportedOperationException: org.hibernate.dialect.Oracle9iDialect does not support resultsets via stored procedures [10/21/15 19:14:38:141 IST] 0000005f SystemErr R at org.hibernate.dialect.Dialect.registerResultSetOutParameter(Dialect.java:1612) [10/21/15 19:14:38:141 IST] 0000005f SystemErr R at org.hibernate.engine.jdbc.cursor.internal.StandardRefCursorSupport.registerRefCursorParameter(StandardRefCursorSupport.java:94) "
Any support /help at the earliest will be very useful.
|