Browse Source

Merge branch '6.0.x'

# Conflicts:
#	build.gradle
#	framework-platform/framework-platform.gradle
#	spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/NamedParameterJdbcTemplate.java
pull/31309/merge
Juergen Hoeller 1 year ago
parent
commit
0e6bf098cb
  1. 28
      framework-platform/framework-platform.gradle
  2. 14
      spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/NamedParameterJdbcOperations.java
  3. 10
      spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/NamedParameterJdbcTemplate.java

28
framework-platform/framework-platform.gradle

@ -9,7 +9,7 @@ javaPlatform {
dependencies { dependencies {
api(platform("com.fasterxml.jackson:jackson-bom:2.15.2")) api(platform("com.fasterxml.jackson:jackson-bom:2.15.2"))
api(platform("io.micrometer:micrometer-bom:1.12.0")) api(platform("io.micrometer:micrometer-bom:1.12.0"))
api(platform("io.netty:netty-bom:4.1.100.Final")) api(platform("io.netty:netty-bom:4.1.101.Final"))
api(platform("io.netty:netty5-bom:5.0.0.Alpha5")) api(platform("io.netty:netty5-bom:5.0.0.Alpha5"))
api(platform("io.projectreactor:reactor-bom:2023.0.0-RC1")) api(platform("io.projectreactor:reactor-bom:2023.0.0-RC1"))
api(platform("io.rsocket:rsocket-bom:1.1.3")) api(platform("io.rsocket:rsocket-bom:1.1.3"))
@ -26,12 +26,12 @@ dependencies {
api("com.fasterxml:aalto-xml:1.3.2") api("com.fasterxml:aalto-xml:1.3.2")
api("com.fasterxml.woodstox:woodstox-core:6.5.1") api("com.fasterxml.woodstox:woodstox-core:6.5.1")
api("com.github.ben-manes.caffeine:caffeine:3.1.8") api("com.github.ben-manes.caffeine:caffeine:3.1.8")
api("com.github.librepdf:openpdf:1.3.30") api("com.github.librepdf:openpdf:1.3.33")
api("com.google.code.findbugs:findbugs:3.0.1") api("com.google.code.findbugs:findbugs:3.0.1")
api("com.google.code.findbugs:jsr305:3.0.2") api("com.google.code.findbugs:jsr305:3.0.2")
api("com.google.code.gson:gson:2.10.1") api("com.google.code.gson:gson:2.10.1")
api("com.google.protobuf:protobuf-java-util:3.24.4") api("com.google.protobuf:protobuf-java-util:3.24.4")
api("com.h2database:h2:2.2.220") api("com.h2database:h2:2.2.224")
api("com.jayway.jsonpath:json-path:2.8.0") api("com.jayway.jsonpath:json-path:2.8.0")
api("com.rometools:rome:1.19.0") api("com.rometools:rome:1.19.0")
api("com.squareup.okhttp3:mockwebserver:3.14.9") api("com.squareup.okhttp3:mockwebserver:3.14.9")
@ -43,7 +43,7 @@ dependencies {
api("com.sun.xml.bind:jaxb-xjc:3.0.2") api("com.sun.xml.bind:jaxb-xjc:3.0.2")
api("com.thoughtworks.qdox:qdox:2.0.3") api("com.thoughtworks.qdox:qdox:2.0.3")
api("com.thoughtworks.xstream:xstream:1.4.20") api("com.thoughtworks.xstream:xstream:1.4.20")
api("commons-io:commons-io:2.11.0") api("commons-io:commons-io:2.15.0")
api("de.bechte.junit:junit-hierarchicalcontextrunner:4.12.2") api("de.bechte.junit:junit-hierarchicalcontextrunner:4.12.2")
api("io.micrometer:context-propagation:1.1.0") api("io.micrometer:context-propagation:1.1.0")
api("io.mockk:mockk:1.13.4") api("io.mockk:mockk:1.13.4")
@ -52,7 +52,7 @@ dependencies {
api("io.r2dbc:r2dbc-h2:1.0.0.RELEASE") api("io.r2dbc:r2dbc-h2:1.0.0.RELEASE")
api("io.r2dbc:r2dbc-spi-test:1.0.0.RELEASE") api("io.r2dbc:r2dbc-spi-test:1.0.0.RELEASE")
api("io.r2dbc:r2dbc-spi:1.0.0.RELEASE") api("io.r2dbc:r2dbc-spi:1.0.0.RELEASE")
api("io.reactivex.rxjava3:rxjava:3.1.6") api("io.reactivex.rxjava3:rxjava:3.1.8")
api("io.smallrye.reactive:mutiny:1.9.0") api("io.smallrye.reactive:mutiny:1.9.0")
api("io.undertow:undertow-core:2.3.10.Final") api("io.undertow:undertow-core:2.3.10.Final")
api("io.undertow:undertow-servlet:2.3.10.Final") api("io.undertow:undertow-servlet:2.3.10.Final")
@ -90,9 +90,9 @@ dependencies {
api("net.sf.jopt-simple:jopt-simple:5.0.4") api("net.sf.jopt-simple:jopt-simple:5.0.4")
api("net.sourceforge.htmlunit:htmlunit:2.70.0") api("net.sourceforge.htmlunit:htmlunit:2.70.0")
api("org.apache-extras.beanshell:bsh:2.0b6") api("org.apache-extras.beanshell:bsh:2.0b6")
api("org.apache.activemq:activemq-broker:5.17.4") api("org.apache.activemq:activemq-broker:5.17.6")
api("org.apache.activemq:activemq-kahadb-store:5.17.4") api("org.apache.activemq:activemq-kahadb-store:5.17.6")
api("org.apache.activemq:activemq-stomp:5.17.4") api("org.apache.activemq:activemq-stomp:5.17.6")
api("org.apache.activemq:artemis-junit-5:2.29.0") api("org.apache.activemq:artemis-junit-5:2.29.0")
api("org.apache.activemq:artemis-jakarta-client:2.29.0") api("org.apache.activemq:artemis-jakarta-client:2.29.0")
api("org.apache.commons:commons-pool2:2.9.0") api("org.apache.commons:commons-pool2:2.9.0")
@ -100,8 +100,8 @@ dependencies {
api("org.apache.derby:derbyclient:10.16.1.1") api("org.apache.derby:derbyclient:10.16.1.1")
api("org.apache.derby:derbytools:10.16.1.1") api("org.apache.derby:derbytools:10.16.1.1")
api("org.apache.httpcomponents.client5:httpclient5:5.2.1") api("org.apache.httpcomponents.client5:httpclient5:5.2.1")
api("org.apache.httpcomponents.core5:httpcore5-reactive:5.2.2") api("org.apache.httpcomponents.core5:httpcore5-reactive:5.2.3")
api("org.apache.poi:poi-ooxml:5.2.3") api("org.apache.poi:poi-ooxml:5.2.4")
api("org.apache.tomcat.embed:tomcat-embed-core:10.1.15") api("org.apache.tomcat.embed:tomcat-embed-core:10.1.15")
api("org.apache.tomcat.embed:tomcat-embed-websocket:10.1.15") api("org.apache.tomcat.embed:tomcat-embed-websocket:10.1.15")
api("org.apache.tomcat:tomcat-util:10.1.15") api("org.apache.tomcat:tomcat-util:10.1.15")
@ -121,18 +121,16 @@ dependencies {
api("org.ehcache:ehcache:3.10.8") api("org.ehcache:ehcache:3.10.8")
api("org.ehcache:jcache:1.0.1") api("org.ehcache:jcache:1.0.1")
api("org.freemarker:freemarker:2.3.32") api("org.freemarker:freemarker:2.3.32")
// Substitute for "javax.management:jmxremote_optional:1.0.1_04" which
// is not available on Maven Central
api("org.glassfish.external:opendmk_jmxremote_optional_jar:1.0-b01-ea") api("org.glassfish.external:opendmk_jmxremote_optional_jar:1.0-b01-ea")
api("org.glassfish.tyrus:tyrus-container-servlet:2.1.3")
api("org.glassfish:jakarta.el:4.0.2") api("org.glassfish:jakarta.el:4.0.2")
api("org.glassfish.tyrus:tyrus-container-servlet:2.1.3")
api("org.graalvm.sdk:graal-sdk:22.3.1") api("org.graalvm.sdk:graal-sdk:22.3.1")
api("org.hamcrest:hamcrest:2.2") api("org.hamcrest:hamcrest:2.2")
api("org.hibernate:hibernate-core-jakarta:5.6.15.Final") api("org.hibernate:hibernate-core-jakarta:5.6.15.Final")
api("org.hibernate:hibernate-validator:7.0.5.Final") api("org.hibernate:hibernate-validator:7.0.5.Final")
api("org.hsqldb:hsqldb:2.7.2") api("org.hsqldb:hsqldb:2.7.2")
api("org.javamoney:moneta:1.4.2") api("org.javamoney:moneta:1.4.2")
api("org.jruby:jruby:9.4.3.0") api("org.jruby:jruby:9.4.5.0")
api("org.junit.support:testng-engine:1.0.4") api("org.junit.support:testng-engine:1.0.4")
api("org.mozilla:rhino:1.7.14") api("org.mozilla:rhino:1.7.14")
api("org.ogce:xpp3:1.1.6") api("org.ogce:xpp3:1.1.6")
@ -144,7 +142,7 @@ dependencies {
api("org.slf4j:slf4j-api:2.0.9") api("org.slf4j:slf4j-api:2.0.9")
api("org.testng:testng:7.8.0") api("org.testng:testng:7.8.0")
api("org.webjars:underscorejs:1.8.3") api("org.webjars:underscorejs:1.8.3")
api("org.webjars:webjars-locator-core:0.53") api("org.webjars:webjars-locator-core:0.55")
api("org.xmlunit:xmlunit-assertj:2.9.1") api("org.xmlunit:xmlunit-assertj:2.9.1")
api("org.xmlunit:xmlunit-matchers:2.9.1") api("org.xmlunit:xmlunit-matchers:2.9.1")
api("org.yaml:snakeyaml:2.2") api("org.yaml:snakeyaml:2.2")

14
spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/NamedParameterJdbcOperations.java

@ -533,27 +533,27 @@ public interface NamedParameterJdbcOperations {
throws DataAccessException; throws DataAccessException;
/** /**
* Executes a batch using the supplied SQL statement with the batch of supplied arguments. * Execute a batch using the supplied SQL statement with the batch of supplied arguments.
* @param sql the SQL statement to execute * @param sql the SQL statement to execute
* @param batchValues the array of Maps containing the batch of arguments for the query * @param batchArgs the array of {@link SqlParameterSource} containing the batch of
* arguments for the query
* @return an array containing the numbers of rows affected by each update in the batch * @return an array containing the numbers of rows affected by each update in the batch
* (may also contain special JDBC-defined negative values for affected rows such as * (may also contain special JDBC-defined negative values for affected rows such as
* {@link java.sql.Statement#SUCCESS_NO_INFO}/{@link java.sql.Statement#EXECUTE_FAILED}) * {@link java.sql.Statement#SUCCESS_NO_INFO}/{@link java.sql.Statement#EXECUTE_FAILED})
* @throws DataAccessException if there is any problem issuing the update * @throws DataAccessException if there is any problem issuing the update
*/ */
int[] batchUpdate(String sql, Map<String, ?>[] batchValues); int[] batchUpdate(String sql, SqlParameterSource[] batchArgs);
/** /**
* Execute a batch using the supplied SQL statement with the batch of supplied arguments. * Executes a batch using the supplied SQL statement with the batch of supplied arguments.
* @param sql the SQL statement to execute * @param sql the SQL statement to execute
* @param batchArgs the array of {@link SqlParameterSource} containing the batch of * @param batchValues the array of Maps containing the batch of arguments for the query
* arguments for the query
* @return an array containing the numbers of rows affected by each update in the batch * @return an array containing the numbers of rows affected by each update in the batch
* (may also contain special JDBC-defined negative values for affected rows such as * (may also contain special JDBC-defined negative values for affected rows such as
* {@link java.sql.Statement#SUCCESS_NO_INFO}/{@link java.sql.Statement#EXECUTE_FAILED}) * {@link java.sql.Statement#SUCCESS_NO_INFO}/{@link java.sql.Statement#EXECUTE_FAILED})
* @throws DataAccessException if there is any problem issuing the update * @throws DataAccessException if there is any problem issuing the update
*/ */
int[] batchUpdate(String sql, SqlParameterSource[] batchArgs); int[] batchUpdate(String sql, Map<String, ?>[] batchValues);
/** /**
* Execute a batch using the supplied SQL statement with the batch of supplied * Execute a batch using the supplied SQL statement with the batch of supplied

10
spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/NamedParameterJdbcTemplate.java

@ -365,11 +365,6 @@ public class NamedParameterJdbcTemplate implements NamedParameterJdbcOperations
return getJdbcOperations().update(psc, generatedKeyHolder); return getJdbcOperations().update(psc, generatedKeyHolder);
} }
@Override
public int[] batchUpdate(String sql, Map<String, ?>[] batchValues) {
return batchUpdate(sql, SqlParameterSourceUtils.createBatch(batchValues));
}
@Override @Override
public int[] batchUpdate(String sql, SqlParameterSource[] batchArgs) { public int[] batchUpdate(String sql, SqlParameterSource[] batchArgs) {
if (batchArgs.length == 0) { if (batchArgs.length == 0) {
@ -394,6 +389,11 @@ public class NamedParameterJdbcTemplate implements NamedParameterJdbcOperations
}); });
} }
@Override
public int[] batchUpdate(String sql, Map<String, ?>[] batchValues) {
return batchUpdate(sql, SqlParameterSourceUtils.createBatch(batchValues));
}
@Override @Override
public int[] batchUpdate(String sql, SqlParameterSource[] batchArgs, KeyHolder generatedKeyHolder) { public int[] batchUpdate(String sql, SqlParameterSource[] batchArgs, KeyHolder generatedKeyHolder) {
return batchUpdate(sql, batchArgs, generatedKeyHolder, null); return batchUpdate(sql, batchArgs, generatedKeyHolder, null);

Loading…
Cancel
Save