Browse Source

MapSqlParameterSource.addValue declares nullable value parameter

Issue: SPR-16843
pull/1833/head
Juergen Hoeller 7 years ago
parent
commit
d9c63182d9
  1. 8
      spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/MapSqlParameterSource.java

8
spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/MapSqlParameterSource.java

@ -63,7 +63,7 @@ public class MapSqlParameterSource extends AbstractSqlParameterSource { @@ -63,7 +63,7 @@ public class MapSqlParameterSource extends AbstractSqlParameterSource {
* @param value the value of the parameter
* @see #addValue(String, Object)
*/
public MapSqlParameterSource(String paramName, Object value) {
public MapSqlParameterSource(String paramName, @Nullable Object value) {
addValue(paramName, value);
}
@ -83,7 +83,7 @@ public class MapSqlParameterSource extends AbstractSqlParameterSource { @@ -83,7 +83,7 @@ public class MapSqlParameterSource extends AbstractSqlParameterSource {
* @return a reference to this parameter source,
* so it's possible to chain several calls together
*/
public MapSqlParameterSource addValue(String paramName, Object value) {
public MapSqlParameterSource addValue(String paramName, @Nullable Object value) {
Assert.notNull(paramName, "Parameter name must not be null");
this.values.put(paramName, value);
if (value instanceof SqlParameterValue) {
@ -100,7 +100,7 @@ public class MapSqlParameterSource extends AbstractSqlParameterSource { @@ -100,7 +100,7 @@ public class MapSqlParameterSource extends AbstractSqlParameterSource {
* @return a reference to this parameter source,
* so it's possible to chain several calls together
*/
public MapSqlParameterSource addValue(String paramName, Object value, int sqlType) {
public MapSqlParameterSource addValue(String paramName, @Nullable Object value, int sqlType) {
Assert.notNull(paramName, "Parameter name must not be null");
this.values.put(paramName, value);
registerSqlType(paramName, sqlType);
@ -116,7 +116,7 @@ public class MapSqlParameterSource extends AbstractSqlParameterSource { @@ -116,7 +116,7 @@ public class MapSqlParameterSource extends AbstractSqlParameterSource {
* @return a reference to this parameter source,
* so it's possible to chain several calls together
*/
public MapSqlParameterSource addValue(String paramName, Object value, int sqlType, String typeName) {
public MapSqlParameterSource addValue(String paramName, @Nullable Object value, int sqlType, String typeName) {
Assert.notNull(paramName, "Parameter name must not be null");
this.values.put(paramName, value);
registerSqlType(paramName, sqlType);

Loading…
Cancel
Save