Skip to content

Commit e660859

Browse files
committed
Consistent ordering of overloaded operations
(cherry picked from commit c373f49)
1 parent a6ab308 commit e660859

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

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

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -527,26 +527,26 @@ int update(String sql, SqlParameterSource paramSource, KeyHolder generatedKeyHol
527527
throws DataAccessException;
528528

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

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

552552
}

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -359,11 +359,6 @@ public int update(
359359
return getJdbcOperations().update(psc, generatedKeyHolder);
360360
}
361361

362-
@Override
363-
public int[] batchUpdate(String sql, Map<String, ?>[] batchValues) {
364-
return batchUpdate(sql, SqlParameterSourceUtils.createBatch(batchValues));
365-
}
366-
367362
@Override
368363
public int[] batchUpdate(String sql, SqlParameterSource[] batchArgs) {
369364
if (batchArgs.length == 0) {
@@ -388,6 +383,11 @@ public int getBatchSize() {
388383
});
389384
}
390385

386+
@Override
387+
public int[] batchUpdate(String sql, Map<String, ?>[] batchValues) {
388+
return batchUpdate(sql, SqlParameterSourceUtils.createBatch(batchValues));
389+
}
390+
391391

392392
/**
393393
* Build a {@link PreparedStatementCreator} based on the given SQL and named parameters.

0 commit comments

Comments
 (0)