We're updating the issue view to help you get more done. 

Named output parameters don't work for stored procedure call

Description

In ProcedureCallImpl:

1 2 3 4 5 private void prepareForNamedParameters() { if ( parameterStrategy == ParameterStrategy.POSITIONAL ) { throw new QueryException( "Cannot mix named and positional parameters" ); } if ( parameterStrategy == null ) {

I think parameterStrategy can never be null. The check should probably be for ParameterStrategy.UNKNOWN.

A stored procedure call with named output parameters (input works) currently throws this:

1 2 3 4 5 6 7 8 java.lang.IllegalArgumentException: Invalid mix of named and positional parameters at org.hibernate.jpa.internal.StoredProcedureQueryImpl.getOutputParameterValue(StoredProcedureQueryImpl.java:293) … Caused by: org.hibernate.procedure.ParameterStrategyException: Names were not used to register parameters with this stored procedure call at org.hibernate.procedure.internal.ProcedureCallImpl.getParameterRegistration(ProcedureCallImpl.java:358) at org.hibernate.procedure.internal.ProcedureOutputsImpl.getOutputParameterValue(ProcedureOutputsImpl.java:63) at org.hibernate.jpa.internal.StoredProcedureQueryImpl.getOutputParameterValue(StoredProcedureQueryImpl.java:290)

Environment

None

Status

Assignee

Steve Ebersole

Reporter

Christian Bauer

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

4.3.0.Beta5

Priority

Major