added null check for parameter (SPR-7193)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3322 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
parent
7300f287c4
commit
b5588049aa
|
|
@ -34,6 +34,7 @@ import org.springframework.jdbc.core.RowMapper;
|
||||||
import org.springframework.jdbc.core.SqlParameter;
|
import org.springframework.jdbc.core.SqlParameter;
|
||||||
import org.springframework.jdbc.core.metadata.CallMetaDataContext;
|
import org.springframework.jdbc.core.metadata.CallMetaDataContext;
|
||||||
import org.springframework.jdbc.core.namedparam.SqlParameterSource;
|
import org.springframework.jdbc.core.namedparam.SqlParameterSource;
|
||||||
|
import org.springframework.util.Assert;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -203,6 +204,7 @@ public abstract class AbstractJdbcCall {
|
||||||
* @param parameter the {@link SqlParameter} to add
|
* @param parameter the {@link SqlParameter} to add
|
||||||
*/
|
*/
|
||||||
public void addDeclaredParameter(SqlParameter parameter) {
|
public void addDeclaredParameter(SqlParameter parameter) {
|
||||||
|
Assert.notNull(parameter, "The supplied parameter must not be null");
|
||||||
if (!StringUtils.hasText(parameter.getName())) {
|
if (!StringUtils.hasText(parameter.getName())) {
|
||||||
throw new InvalidDataAccessApiUsageException(
|
throw new InvalidDataAccessApiUsageException(
|
||||||
"You must specify a parameter name when declaring parameters for \"" + getProcedureName() + "\"");
|
"You must specify a parameter name when declaring parameters for \"" + getProcedureName() + "\"");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue