From c5d3bcfb14115bb20fdc7aac941f0472e717d342 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Sat, 5 Sep 2020 12:59:34 +0200 Subject: [PATCH] Restore original 4.x behavior for initialization of function return name Closes gh-25707 (cherry picked from commit 40bf83c9e585bcca99dc321f071f69f4e7cdffa9) --- .../jdbc/core/metadata/CallMetaDataContext.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/CallMetaDataContext.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/CallMetaDataContext.java index 374dac454d03..d24e50d7f01c 100755 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/CallMetaDataContext.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/CallMetaDataContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -355,7 +355,7 @@ protected List reconcileParameters(List parameters) logger.debug("Using declared out parameter '" + paramName + "' for function return value"); } - setFunctionReturnName(paramName); + this.actualFunctionReturnName = paramName; returnDeclared = true; } } @@ -393,8 +393,8 @@ protected List reconcileParameters(List parameters) "Unable to locate declared parameter for function return value - " + " add a SqlOutParameter with name '" + getFunctionReturnName() + "'"); } - else if (paramName != null) { - setFunctionReturnName(paramName); + else { + this.actualFunctionReturnName = param.getName(); } } else { @@ -422,7 +422,7 @@ else if (paramName != null) { (StringUtils.hasLength(paramNameToUse) ? paramNameToUse : getFunctionReturnName()); workParams.add(provider.createDefaultOutParameter(returnNameToUse, meta)); if (isFunction()) { - setFunctionReturnName(returnNameToUse); + this.actualFunctionReturnName = returnNameToUse; outParamNames.add(returnNameToUse); } if (logger.isDebugEnabled()) {