Implement REF_CURSOR support for StoredProcedureQuery.getOutputParameterValue(4);

Description

Getting ref cursor from a SP is working when we use query.getResultList();

But when we try to get parameter by position or name, Hibernate is throwing exception.

org.hibernate.procedure.internal.AbstractParameterRegistrationImpl.java

From section 3.10.17.3 Stored Procedure Query Execution of the JPA2.1 spec:

JPA2.1 spec

When using REF_CURSOR parameters for result sets, the update counts should be exhausted before
calling getResultList to retrieve the result set. Alternatively, the REF_CURSOR result set can be
retrieved through getOutputParameterValue. Result set mappings will be applied to results corresponding
to REF_CURSOR parameters in the order the REF_CURSOR parameters were registered
with the query.

Environment

None

Status

Assignee

Vlad Mihalcea

Reporter

Vishnudev K

Fix versions

Labels

backPortable

Backport?

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure