Uploaded image for project: 'Hibernate ORM'
  1. HHH-8684

Named output parameters don't work for stored procedure call

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects versions: 4.3.0.Beta5
    • Fix versions: 4.3.0.CR1
    • Components: None
    • Labels:
      None
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true
    • Sprint:

      Description

      In ProcedureCallImpl:

      	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:

      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)
      

        Attachments

          Issue links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - Not Specified
                  Not Specified
                  Logged:
                  Time Spent - 1m
                  1m