From 770c8059d9a1fb828a5a9fc9ff2532b4360e423e Mon Sep 17 00:00:00 2001 From: Carsten Dimmek Date: Wed, 16 Dec 2020 18:44:01 +0100 Subject: [PATCH] Make set operator for MapSqlParameterSource accept nullable value The addValue methods of MapSqlParameterSource accept null values, but you're not able to set null values if you try to use the Kotlin extension methods. --- .../jdbc/core/namedparam/MapSqlParameterSourceExtensions.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spring-jdbc/src/main/kotlin/org/springframework/jdbc/core/namedparam/MapSqlParameterSourceExtensions.kt b/spring-jdbc/src/main/kotlin/org/springframework/jdbc/core/namedparam/MapSqlParameterSourceExtensions.kt index c5d74dea04a8..9893a4045a88 100644 --- a/spring-jdbc/src/main/kotlin/org/springframework/jdbc/core/namedparam/MapSqlParameterSourceExtensions.kt +++ b/spring-jdbc/src/main/kotlin/org/springframework/jdbc/core/namedparam/MapSqlParameterSourceExtensions.kt @@ -26,7 +26,7 @@ package org.springframework.jdbc.core.namedparam * @since 5.0 * */ -operator fun MapSqlParameterSource.set(paramName: String, value: Any) { +operator fun MapSqlParameterSource.set(paramName: String, value: Any?) { this.addValue(paramName, value) } @@ -40,7 +40,7 @@ operator fun MapSqlParameterSource.set(paramName: String, value: Any) { * @since 5.0 * */ -operator fun MapSqlParameterSource.set(paramName: String, sqlType: Int, value: Any) { +operator fun MapSqlParameterSource.set(paramName: String, sqlType: Int, value: Any?) { this.addValue(paramName, value, sqlType) } @@ -54,6 +54,6 @@ operator fun MapSqlParameterSource.set(paramName: String, sqlType: Int, value: A * @since 5.0 * */ -operator fun MapSqlParameterSource.set(paramName: String, sqlType: Int, typeName: String, value: Any) { +operator fun MapSqlParameterSource.set(paramName: String, sqlType: Int, typeName: String, value: Any?) { this.addValue(paramName, value, sqlType, typeName) }