Browse Source

Polishing (backported from 5.2.x)

5.0.x
Juergen Hoeller 5 years ago
parent
commit
72b52d478b
  1. 2
      spring-jdbc/src/main/java/org/springframework/jdbc/core/DisposableSqlTypeValue.java
  2. 14
      spring-jdbc/src/main/java/org/springframework/jdbc/core/JdbcOperations.java
  3. 10
      spring-jdbc/src/main/java/org/springframework/jdbc/core/JdbcTemplate.java
  4. 2
      spring-jdbc/src/main/java/org/springframework/jdbc/core/ParameterDisposer.java
  5. 6
      spring-jdbc/src/main/java/org/springframework/jdbc/core/StatementCreatorUtils.java
  6. 2
      spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/CallMetaDataContext.java
  7. 22
      spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/CallParameterMetaData.java
  8. 8
      spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/NamedParameterJdbcOperations.java
  9. 4
      spring-jdbc/src/main/java/org/springframework/jdbc/support/rowset/SqlRowSet.java

2
spring-jdbc/src/main/java/org/springframework/jdbc/core/DisposableSqlTypeValue.java

@ -29,7 +29,7 @@ public interface DisposableSqlTypeValue extends SqlTypeValue { @@ -29,7 +29,7 @@ public interface DisposableSqlTypeValue extends SqlTypeValue {
/**
* Clean up resources held by this type value,
* for example the LobCreator in case of a SqlLobValue.
* for example the LobCreator in case of an SqlLobValue.
* @see org.springframework.jdbc.core.support.SqlLobValue#cleanup()
* @see org.springframework.jdbc.support.SqlValue#cleanup()
*/

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

@ -223,7 +223,7 @@ public interface JdbcOperations { @@ -223,7 +223,7 @@ public interface JdbcOperations {
List<Map<String, Object>> queryForList(String sql) throws DataAccessException;
/**
* Execute a query for a SqlRowSet, given static SQL.
* Execute a query for an SqlRowSet, given static SQL.
* <p>Uses a JDBC Statement, not a PreparedStatement. If you want to
* execute a static query with a PreparedStatement, use the overloaded
* {@code queryForRowSet} method with {@code null} as argument array.
@ -234,7 +234,7 @@ public interface JdbcOperations { @@ -234,7 +234,7 @@ public interface JdbcOperations {
* class is used, which is part of JDK 1.5+ and also available separately as part of
* Sun's JDBC RowSet Implementations download (rowset.jar).
* @param sql the SQL query to execute
* @return a SqlRowSet representation (possibly a wrapper around a
* @return an SqlRowSet representation (possibly a wrapper around a
* {@code javax.sql.rowset.CachedRowSet})
* @throws DataAccessException if there is any problem executing the query
* @see #queryForRowSet(String, Object...)
@ -775,7 +775,7 @@ public interface JdbcOperations { @@ -775,7 +775,7 @@ public interface JdbcOperations {
/**
* Query given SQL to create a prepared statement from SQL and a list of
* arguments to bind to the query, expecting a SqlRowSet.
* arguments to bind to the query, expecting an SqlRowSet.
* <p>The results will be mapped to an SqlRowSet which holds the data in a
* disconnected fashion. This wrapper will translate any SQLExceptions thrown.
* <p>Note that, for the default implementation, JDBC RowSet support needs to
@ -786,7 +786,7 @@ public interface JdbcOperations { @@ -786,7 +786,7 @@ public interface JdbcOperations {
* @param args arguments to bind to the query
* @param argTypes the SQL types of the arguments
* (constants from {@code java.sql.Types})
* @return a SqlRowSet representation (possibly a wrapper around a
* @return an SqlRowSet representation (possibly a wrapper around a
* {@code javax.sql.rowset.CachedRowSet})
* @throws DataAccessException if there is any problem executing the query
* @see #queryForRowSet(String)
@ -798,7 +798,7 @@ public interface JdbcOperations { @@ -798,7 +798,7 @@ public interface JdbcOperations {
/**
* Query given SQL to create a prepared statement from SQL and a list of
* arguments to bind to the query, expecting a SqlRowSet.
* arguments to bind to the query, expecting an SqlRowSet.
* <p>The results will be mapped to an SqlRowSet which holds the data in a
* disconnected fashion. This wrapper will translate any SQLExceptions thrown.
* <p>Note that, for the default implementation, JDBC RowSet support needs to
@ -810,7 +810,7 @@ public interface JdbcOperations { @@ -810,7 +810,7 @@ public interface JdbcOperations {
* (leaving it to the PreparedStatement to guess the corresponding SQL type);
* may also contain {@link SqlParameterValue} objects which indicate not
* only the argument value but also the SQL type and optionally the scale
* @return a SqlRowSet representation (possibly a wrapper around a
* @return an SqlRowSet representation (possibly a wrapper around a
* {@code javax.sql.rowset.CachedRowSet})
* @throws DataAccessException if there is any problem executing the query
* @see #queryForRowSet(String)
@ -974,7 +974,7 @@ public interface JdbcOperations { @@ -974,7 +974,7 @@ public interface JdbcOperations {
<T> T execute(String callString, CallableStatementCallback<T> action) throws DataAccessException;
/**
* Execute a SQL call using a CallableStatementCreator to provide SQL and
* Execute an SQL call using a CallableStatementCreator to provide SQL and
* any required parameters.
* @param csc a callback that provides SQL and any necessary parameters
* @param declaredParameters list of declared SqlParameter objects

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -182,7 +182,7 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations { @@ -182,7 +182,7 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
/**
* Set whether or not we want to ignore SQLWarnings.
* <p>Default is "true", swallowing and logging all warnings. Switch this flag
* to "false" to make the JdbcTemplate throw a SQLWarningException instead.
* to "false" to make the JdbcTemplate throw an SQLWarningException instead.
* @see java.sql.SQLWarning
* @see org.springframework.jdbc.SQLWarningException
* @see #handleWarnings
@ -1350,7 +1350,7 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations { @@ -1350,7 +1350,7 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
}
/**
* Throw a SQLWarningException if we're not ignoring warnings,
* Throw an SQLWarningException if we're not ignoring warnings,
* otherwise log the warnings at debug level.
* @param stmt the current JDBC statement
* @throws SQLWarningException if not ignoring warnings
@ -1373,7 +1373,7 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations { @@ -1373,7 +1373,7 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
}
/**
* Throw a SQLWarningException if encountering an actual warning.
* Throw an SQLWarningException if encountering an actual warning.
* @param warning the warnings object from the current statement.
* May be {@code null}, in which case this method does nothing.
* @throws SQLWarningException in case of an actual warning to be raised
@ -1401,7 +1401,7 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations { @@ -1401,7 +1401,7 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
/**
* Determine SQL from potential provider object.
* @param sqlProvider object which is potentially a SqlProvider
* @param sqlProvider object which is potentially an SqlProvider
* @return the SQL string, or {@code null} if not known
* @see SqlProvider
*/

2
spring-jdbc/src/main/java/org/springframework/jdbc/core/ParameterDisposer.java

@ -37,7 +37,7 @@ public interface ParameterDisposer { @@ -37,7 +37,7 @@ public interface ParameterDisposer {
/**
* Close the resources allocated by parameters that the implementing
* object holds, for example in case of a DisposableSqlTypeValue
* (like a SqlLobValue).
* (like an SqlLobValue).
* @see DisposableSqlTypeValue#cleanup()
* @see org.springframework.jdbc.core.support.SqlLobValue#cleanup()
*/

6
spring-jdbc/src/main/java/org/springframework/jdbc/core/StatementCreatorUtils.java

@ -152,7 +152,7 @@ public abstract class StatementCreatorUtils { @@ -152,7 +152,7 @@ public abstract class StatementCreatorUtils {
* @param ps the prepared statement or callable statement
* @param paramIndex index of the parameter we are setting
* @param sqlType the SQL type of the parameter
* @param inValue the value to set (plain value or a SqlTypeValue)
* @param inValue the value to set (plain value or an SqlTypeValue)
* @throws SQLException if thrown by PreparedStatement methods
* @see SqlTypeValue
*/
@ -170,7 +170,7 @@ public abstract class StatementCreatorUtils { @@ -170,7 +170,7 @@ public abstract class StatementCreatorUtils {
* @param sqlType the SQL type of the parameter
* @param typeName the type name of the parameter
* (optional, only used for SQL NULL and SqlTypeValue)
* @param inValue the value to set (plain value or a SqlTypeValue)
* @param inValue the value to set (plain value or an SqlTypeValue)
* @throws SQLException if thrown by PreparedStatement methods
* @see SqlTypeValue
*/
@ -190,7 +190,7 @@ public abstract class StatementCreatorUtils { @@ -190,7 +190,7 @@ public abstract class StatementCreatorUtils {
* (optional, only used for SQL NULL and SqlTypeValue)
* @param scale the number of digits after the decimal point
* (for DECIMAL and NUMERIC types)
* @param inValue the value to set (plain value or a SqlTypeValue)
* @param inValue the value to set (plain value or an SqlTypeValue)
* @throws SQLException if thrown by PreparedStatement methods
* @see SqlTypeValue
*/

2
spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/CallMetaDataContext.java

@ -390,7 +390,7 @@ public class CallMetaDataContext { @@ -390,7 +390,7 @@ public class CallMetaDataContext {
if (param == null) {
throw new InvalidDataAccessApiUsageException(
"Unable to locate declared parameter for function return value - " +
" add a SqlOutParameter with name '" + getFunctionReturnName() + "'");
" add an SqlOutParameter with name '" + getFunctionReturnName() + "'");
}
else {
this.actualFunctionReturnName = param.getName();

22
spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/CallParameterMetaData.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -31,16 +31,16 @@ import org.springframework.lang.Nullable; @@ -31,16 +31,16 @@ import org.springframework.lang.Nullable;
public class CallParameterMetaData {
@Nullable
private String parameterName;
private final String parameterName;
private int parameterType;
private final int parameterType;
private int sqlType;
private final int sqlType;
@Nullable
private String typeName;
private final String typeName;
private boolean nullable;
private final boolean nullable;
/**
@ -58,7 +58,7 @@ public class CallParameterMetaData { @@ -58,7 +58,7 @@ public class CallParameterMetaData {
/**
* Get the parameter name.
* Return the parameter name.
*/
@Nullable
public String getParameterName() {
@ -66,7 +66,7 @@ public class CallParameterMetaData { @@ -66,7 +66,7 @@ public class CallParameterMetaData {
}
/**
* Get the parameter type.
* Return the parameter type.
*/
public int getParameterType() {
return this.parameterType;
@ -84,14 +84,14 @@ public class CallParameterMetaData { @@ -84,14 +84,14 @@ public class CallParameterMetaData {
}
/**
* Get the parameter SQL type.
* Return the parameter SQL type.
*/
public int getSqlType() {
return this.sqlType;
}
/**
* Get the parameter type name.
* Return the parameter type name.
*/
@Nullable
public String getTypeName() {
@ -99,7 +99,7 @@ public class CallParameterMetaData { @@ -99,7 +99,7 @@ public class CallParameterMetaData {
}
/**
* Get whether the parameter is nullable.
* Return whether the parameter is nullable.
*/
public boolean isNullable() {
return this.nullable;

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

@ -406,7 +406,7 @@ public interface NamedParameterJdbcOperations { @@ -406,7 +406,7 @@ public interface NamedParameterJdbcOperations {
/**
* Query given SQL to create a prepared statement from SQL and a
* list of arguments to bind to the query, expecting a SqlRowSet.
* list of arguments to bind to the query, expecting an SqlRowSet.
* <p>The results will be mapped to an SqlRowSet which holds the data in a
* disconnected fashion. This wrapper will translate any SQLExceptions thrown.
* <p>Note that, for the default implementation, JDBC RowSet support needs to
@ -415,7 +415,7 @@ public interface NamedParameterJdbcOperations { @@ -415,7 +415,7 @@ public interface NamedParameterJdbcOperations {
* Sun's JDBC RowSet Implementations download (rowset.jar).
* @param sql the SQL query to execute
* @param paramSource container of arguments to bind to the query
* @return a SqlRowSet representation (possibly a wrapper around a
* @return an SqlRowSet representation (possibly a wrapper around a
* {@code javax.sql.rowset.CachedRowSet})
* @throws DataAccessException if there is any problem executing the query
* @see org.springframework.jdbc.core.JdbcTemplate#queryForRowSet(String)
@ -426,7 +426,7 @@ public interface NamedParameterJdbcOperations { @@ -426,7 +426,7 @@ public interface NamedParameterJdbcOperations {
/**
* Query given SQL to create a prepared statement from SQL and a
* list of arguments to bind to the query, expecting a SqlRowSet.
* list of arguments to bind to the query, expecting an SqlRowSet.
* <p>The results will be mapped to an SqlRowSet which holds the data in a
* disconnected fashion. This wrapper will translate any SQLExceptions thrown.
* <p>Note that, for the default implementation, JDBC RowSet support needs to
@ -436,7 +436,7 @@ public interface NamedParameterJdbcOperations { @@ -436,7 +436,7 @@ public interface NamedParameterJdbcOperations {
* @param sql the SQL query to execute
* @param paramMap map of parameters to bind to the query
* (leaving it to the PreparedStatement to guess the corresponding SQL type)
* @return a SqlRowSet representation (possibly a wrapper around a
* @return an SqlRowSet representation (possibly a wrapper around a
* {@code javax.sql.rowset.CachedRowSet})
* @throws DataAccessException if there is any problem executing the query
* @see org.springframework.jdbc.core.JdbcTemplate#queryForRowSet(String)

4
spring-jdbc/src/main/java/org/springframework/jdbc/support/rowset/SqlRowSet.java

@ -32,8 +32,8 @@ import org.springframework.lang.Nullable; @@ -32,8 +32,8 @@ import org.springframework.lang.Nullable;
* {@link java.sql.ResultSet} data.
*
* <p>The main difference to the standard JDBC RowSet is that a {@link java.sql.SQLException}
* is never thrown here. This allows a SqlRowSet to be used without having to deal with
* checked exceptions. A SqlRowSet will throw Spring's {@link InvalidResultSetAccessException}
* is never thrown here. This allows an SqlRowSet to be used without having to deal with
* checked exceptions. An SqlRowSet will throw Spring's {@link InvalidResultSetAccessException}
* instead (when appropriate).
*
* <p>Note: This interface extends the {@code java.io.Serializable} marker interface.

Loading…
Cancel
Save