Uploaded image for project: 'Spring Data JPA'
  1. Spring Data JPA
  2. DATAJPA-1297

outputParameterName in @Procedure is not being used to create the StoredProcedureAttributes

    Details

      Description

      Currently, the parameter outputParameterName in the @Procedure annotation is not being used to create the corresponding StoredProcedureAttributes.

      This is only a problem when the @Procedure method is being created to bind the parameters by name. However, since spring-boot 2.0, if you inherit from spring-boot-parent, you have by default the compiler flag 'parameters' enabled by default, making the procedure parameters bound by name without the need of explicitly define it.

      The fix in StoredProcedureAttributeSource.createFrom it's trivial. Instead of passing null to the constructor of the StoredProcedureAttributes, we can pass the actual value defined in the annotation.
      Before:

      return new StoredProcedureAttributes(procedureName, null, method.getReturnType(), false);
      

      After:

      return new StoredProcedureAttributes(procedureName, procedure.outputParameterName(), method.getReturnType(), false);
      

        Attachments

          Activity

            People

            • Assignee:
              schauder Jens Schauder
              Reporter:
              didiez Diego Díez Ricondo
              Last updater:
              Mark Paluch
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: