Fix javadoc checkstyle issues

Fix checkstyle violations for javadoc.

Issue: SPR-16968
This commit is contained in:
Phillip Webb
2018-06-20 18:45:54 -07:00
committed by Juergen Hoeller
parent 032096d699
commit e0480f75ac
928 changed files with 3729 additions and 2686 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -42,7 +42,7 @@ public class CannotGetJdbcConnectionException extends DataAccessResourceFailureE
/**
* Constructor for CannotGetJdbcConnectionException.
* @param msg the detail message
* @param ex SQLException root cause
* @param ex the root cause SQLException
*/
public CannotGetJdbcConnectionException(String msg, @Nullable SQLException ex) {
super(msg, ex);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2018 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.
@@ -29,16 +29,16 @@ import org.springframework.dao.IncorrectUpdateSemanticsDataAccessException;
@SuppressWarnings("serial")
public class JdbcUpdateAffectedIncorrectNumberOfRowsException extends IncorrectUpdateSemanticsDataAccessException {
/** Number of rows that should have been affected */
/** Number of rows that should have been affected. */
private int expected;
/** Number of rows that actually were affected */
/** Number of rows that actually were affected. */
private int actual;
/**
* Constructor for JdbcUpdateAffectedIncorrectNumberOfRowsException.
* @param sql SQL we were tring to execute
* @param sql the SQL we were trying to execute
* @param expected the expected number of rows affected
* @param actual the actual number of rows affected
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2018 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.
@@ -40,7 +40,7 @@ public class LobRetrievalFailureException extends DataRetrievalFailureException
/**
* Constructor for LobRetrievalFailureException.
* @param msg the detail message
* @param ex IOException root cause
* @param ex the root cause IOException
*/
public LobRetrievalFailureException(String msg, IOException ex) {
super(msg, ex);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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,7 +31,7 @@ import org.springframework.lang.Nullable;
@SuppressWarnings("serial")
public class UncategorizedSQLException extends UncategorizedDataAccessException {
/** SQL that led to the problem */
/** SQL that led to the problem. */
@Nullable
private final String sql;

View File

@@ -32,6 +32,8 @@ import org.springframework.util.StringUtils;
import org.springframework.util.xml.DomUtils;
/**
* Internal utility methods used with JDBC configuration.
*
* @author Juergen Hoeller
* @author Stephane Nicoll
* @since 3.1

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -73,31 +73,32 @@ import org.springframework.util.StringUtils;
* @author Thomas Risberg
* @author Juergen Hoeller
* @since 2.5
* @param <T> the result type
*/
public class BeanPropertyRowMapper<T> implements RowMapper<T> {
/** Logger available to subclasses */
/** Logger available to subclasses. */
protected final Log logger = LogFactory.getLog(getClass());
/** The class we are mapping to */
/** The class we are mapping to. */
@Nullable
private Class<T> mappedClass;
/** Whether we're strictly validating */
/** Whether we're strictly validating. */
private boolean checkFullyPopulated = false;
/** Whether we're defaulting primitives when mapping a null value */
/** Whether we're defaulting primitives when mapping a null value. */
private boolean primitivesDefaultedForNullValue = false;
/** ConversionService for binding JDBC values to bean properties */
/** ConversionService for binding JDBC values to bean properties. */
@Nullable
private ConversionService conversionService = DefaultConversionService.getSharedInstance();
/** Map of the fields we provide mapping for */
/** Map of the fields we provide mapping for. */
@Nullable
private Map<String, PropertyDescriptor> mappedFields;
/** Set of bean properties we provide mapping for */
/** Set of bean properties we provide mapping for. */
@Nullable
private Set<String> mappedProperties;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 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.
@@ -38,6 +38,7 @@ import org.springframework.lang.Nullable;
*
* @author Juergen Hoeller
* @since 16.03.2004
* @param <T> the result type
* @see JdbcTemplate#execute(String, CallableStatementCallback)
* @see JdbcTemplate#execute(CallableStatementCreator, CallableStatementCallback)
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 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.
@@ -46,7 +46,7 @@ public interface CallableStatementCreator {
/**
* Create a callable statement in this connection. Allows implementations to use
* CallableStatements.
* @param con Connection to use to create statement
* @param con the Connection to use to create statement
* @return a callable statement
* @throws SQLException there is no need to catch SQLExceptions
* that may be thrown in the implementation of this method.

View File

@@ -110,7 +110,7 @@ public class CallableStatementCreatorFactory {
/**
* Return a new CallableStatementCreator instance given this parameter mapper.
* @param inParamMapper ParameterMapper implementation that will return a Map of parameters
* @param inParamMapper the ParameterMapper implementation that will return a Map of parameters
*/
public CallableStatementCreator newCallableStatementCreator(ParameterMapper inParamMapper) {
return new CallableStatementCreatorImpl(inParamMapper);
@@ -130,7 +130,7 @@ public class CallableStatementCreatorFactory {
/**
* Create a new CallableStatementCreatorImpl.
* @param inParamMapper ParameterMapper implementation for mapping input parameters
* @param inParamMapper the ParameterMapper implementation for mapping input parameters
*/
public CallableStatementCreatorImpl(ParameterMapper inParamMapper) {
this.inParameterMapper = inParamMapper;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 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.
@@ -34,6 +34,7 @@ import org.springframework.lang.Nullable;
*
* @author Juergen Hoeller
* @since 1.1.3
* @param <T> the result type
* @see JdbcTemplate#execute(ConnectionCallback)
* @see JdbcTemplate#query
* @see JdbcTemplate#update

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -96,7 +96,7 @@ public interface JdbcOperations {
* <p>Uses a JDBC Statement, not a PreparedStatement. If you want to
* execute a static query with a PreparedStatement, use the overloaded
* {@code query} method with {@code null} as argument array.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param rse object that will extract all rows of results
* @return an arbitrary result object, as returned by the ResultSetExtractor
* @throws DataAccessException if there is any problem executing the query
@@ -111,7 +111,7 @@ public interface JdbcOperations {
* <p>Uses a JDBC Statement, not a PreparedStatement. If you want to
* execute a static query with a PreparedStatement, use the overloaded
* {@code query} method with {@code null} as argument array.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param rch object that will extract results, one row at a time
* @throws DataAccessException if there is any problem executing the query
* @see #query(String, Object[], RowCallbackHandler)
@@ -124,7 +124,7 @@ public interface JdbcOperations {
* <p>Uses a JDBC Statement, not a PreparedStatement. If you want to
* execute a static query with a PreparedStatement, use the overloaded
* {@code query} method with {@code null} as argument array.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param rowMapper object that will map one object per row
* @return the result List, containing mapped objects
* @throws DataAccessException if there is any problem executing the query
@@ -139,7 +139,7 @@ public interface JdbcOperations {
* execute a static query with a PreparedStatement, use the overloaded
* {@link #queryForObject(String, RowMapper, Object...)} method with
* {@code null} as argument array.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param rowMapper object that will map one object per row
* @return the single mapped object (may be {@code null} if the given
* {@link RowMapper} returned {@code} null)
@@ -160,7 +160,7 @@ public interface JdbcOperations {
* <p>This method is useful for running static SQL with a known outcome.
* The query is expected to be a single row/single column query; the returned
* result will be directly mapped to the corresponding object type.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param requiredType the type that the result object is expected to match
* @return the result object of the required type, or {@code null} in case of SQL NULL
* @throws IncorrectResultSizeDataAccessException if the query does not return
@@ -179,7 +179,7 @@ public interface JdbcOperations {
* as argument array.
* <p>The query is expected to be a single row query; the result row will be
* mapped to a Map (one entry for each column, using the column name as the key).
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @return the result Map (one entry for each column, using the
* column name as the key)
* @throws IncorrectResultSizeDataAccessException if the query does not
@@ -197,7 +197,7 @@ public interface JdbcOperations {
* {@code queryForList} method with {@code null} as argument array.
* <p>The results will be mapped to a List (one entry for each row) of
* result objects, each of them matching the specified element type.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param elementType the required type of element in the result list
* (for example, {@code Integer.class})
* @return a List of objects that match the specified element type
@@ -216,7 +216,7 @@ public interface JdbcOperations {
* Maps (one entry for each column using the column name as the key).
* Each element in the list will be of the form returned by this interface's
* queryForMap() methods.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @return an List that contains a Map per row
* @throws DataAccessException if there is any problem executing the query
* @see #queryForList(String, Object[])
@@ -234,7 +234,7 @@ public interface JdbcOperations {
* be available at runtime: by default, Sun's {@code com.sun.rowset.CachedRowSetImpl}
* 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 SQL query to execute
* @param sql the SQL query to execute
* @return a SqlRowSet representation (possibly a wrapper around a
* {@code javax.sql.rowset.CachedRowSet})
* @throws DataAccessException if there is any problem executing the query
@@ -291,7 +291,7 @@ public interface JdbcOperations {
* and converting JDBC SQLExceptions into Spring's DataAccessException hierarchy.
* <p>The callback action can return a result object, for example a
* domain object or a collection of domain objects.
* @param sql SQL to execute
* @param sql the SQL to execute
* @param action callback object that specifies the action
* @return a result object returned by the action, or {@code null}
* @throws DataAccessException if there is any problem
@@ -316,7 +316,7 @@ public interface JdbcOperations {
/**
* Query using a prepared statement, reading the ResultSet with a
* ResultSetExtractor.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param pss object that knows how to set values on the prepared statement.
* If this is {@code null}, the SQL will be assumed to contain no bind parameters.
* Even if there are no bind parameters, this object may be used to
@@ -332,9 +332,9 @@ public interface JdbcOperations {
* Query given SQL to create a prepared statement from SQL and a list
* of arguments to bind to the query, reading the ResultSet with a
* ResultSetExtractor.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param args arguments to bind to the query
* @param argTypes SQL types of the arguments
* @param argTypes the SQL types of the arguments
* (constants from {@code java.sql.Types})
* @param rse object that will extract results
* @return an arbitrary result object, as returned by the ResultSetExtractor
@@ -348,7 +348,7 @@ public interface JdbcOperations {
* Query given SQL to create a prepared statement from SQL and a list
* of arguments to bind to the query, reading the ResultSet with a
* ResultSetExtractor.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param args arguments to bind to the query
* (leaving it to the PreparedStatement to guess the corresponding SQL type);
* may also contain {@link SqlParameterValue} objects which indicate not
@@ -364,7 +364,7 @@ public interface JdbcOperations {
* Query given SQL to create a prepared statement from SQL and a list
* of arguments to bind to the query, reading the ResultSet with a
* ResultSetExtractor.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param rse object that will extract results
* @param args arguments to bind to the query
* (leaving it to the PreparedStatement to guess the corresponding SQL type);
@@ -394,7 +394,7 @@ public interface JdbcOperations {
* PreparedStatementSetter implementation that knows how to bind values
* to the query, reading the ResultSet on a per-row basis with a
* RowCallbackHandler.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param pss object that knows how to set values on the prepared statement.
* If this is {@code null}, the SQL will be assumed to contain no bind parameters.
* Even if there are no bind parameters, this object may be used to
@@ -408,9 +408,9 @@ public interface JdbcOperations {
* Query given SQL to create a prepared statement from SQL and a list of
* arguments to bind to the query, reading the ResultSet on a per-row basis
* with a RowCallbackHandler.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param args arguments to bind to the query
* @param argTypes SQL types of the arguments
* @param argTypes the SQL types of the arguments
* (constants from {@code java.sql.Types})
* @param rch object that will extract results, one row at a time
* @throws DataAccessException if the query fails
@@ -422,7 +422,7 @@ public interface JdbcOperations {
* Query given SQL to create a prepared statement from SQL and a list of
* arguments to bind to the query, reading the ResultSet on a per-row basis
* with a RowCallbackHandler.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param args arguments to bind to the query
* (leaving it to the PreparedStatement to guess the corresponding SQL type);
* may also contain {@link SqlParameterValue} objects which indicate not
@@ -436,7 +436,7 @@ public interface JdbcOperations {
* Query given SQL to create a prepared statement from SQL and a list of
* arguments to bind to the query, reading the ResultSet on a per-row basis
* with a RowCallbackHandler.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param rch object that will extract results, one row at a time
* @param args arguments to bind to the query
* (leaving it to the PreparedStatement to guess the corresponding SQL type);
@@ -464,7 +464,7 @@ public interface JdbcOperations {
* Query given SQL to create a prepared statement from SQL and a
* PreparedStatementSetter implementation that knows how to bind values
* to the query, mapping each row to a Java object via a RowMapper.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param pss object that knows how to set values on the prepared statement.
* If this is {@code null}, the SQL will be assumed to contain no bind parameters.
* Even if there are no bind parameters, this object may be used to
@@ -479,9 +479,9 @@ public interface JdbcOperations {
* Query given SQL to create a prepared statement from SQL and a list
* of arguments to bind to the query, mapping each row to a Java object
* via a RowMapper.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param args arguments to bind to the query
* @param argTypes SQL types of the arguments
* @param argTypes the SQL types of the arguments
* (constants from {@code java.sql.Types})
* @param rowMapper object that will map one object per row
* @return the result List, containing mapped objects
@@ -494,7 +494,7 @@ public interface JdbcOperations {
* Query given SQL to create a prepared statement from SQL and a list
* of arguments to bind to the query, mapping each row to a Java object
* via a RowMapper.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param args arguments to bind to the query
* (leaving it to the PreparedStatement to guess the corresponding SQL type);
* may also contain {@link SqlParameterValue} objects which indicate not
@@ -509,7 +509,7 @@ public interface JdbcOperations {
* Query given SQL to create a prepared statement from SQL and a list
* of arguments to bind to the query, mapping each row to a Java object
* via a RowMapper.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param rowMapper object that will map one object per row
* @param args arguments to bind to the query
* (leaving it to the PreparedStatement to guess the corresponding SQL type);
@@ -525,10 +525,10 @@ public interface JdbcOperations {
* Query given SQL to create a prepared statement from SQL and a list
* of arguments to bind to the query, mapping a single result row to a
* Java object via a RowMapper.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param args arguments to bind to the query
* (leaving it to the PreparedStatement to guess the corresponding SQL type)
* @param argTypes SQL types of the arguments
* @param argTypes the SQL types of the arguments
* (constants from {@code java.sql.Types})
* @param rowMapper object that will map one object per row
* @return the single mapped object (may be {@code null} if the given
@@ -545,7 +545,7 @@ public interface JdbcOperations {
* Query given SQL to create a prepared statement from SQL and a list
* of arguments to bind to the query, mapping a single result row to a
* Java object via a RowMapper.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param args arguments to bind to the query
* (leaving it to the PreparedStatement to guess the corresponding SQL type);
* may also contain {@link SqlParameterValue} objects which indicate not
@@ -564,7 +564,7 @@ public interface JdbcOperations {
* Query given SQL to create a prepared statement from SQL and a list
* of arguments to bind to the query, mapping a single result row to a
* Java object via a RowMapper.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param rowMapper object that will map one object per row
* @param args arguments to bind to the query
* (leaving it to the PreparedStatement to guess the corresponding SQL type);
@@ -585,9 +585,9 @@ public interface JdbcOperations {
* list of arguments to bind to the query, expecting a result object.
* <p>The query is expected to be a single row/single column query; the returned
* result will be directly mapped to the corresponding object type.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param args arguments to bind to the query
* @param argTypes SQL types of the arguments
* @param argTypes the SQL types of the arguments
* (constants from {@code java.sql.Types})
* @param requiredType the type that the result object is expected to match
* @return the result object of the required type, or {@code null} in case of SQL NULL
@@ -606,7 +606,7 @@ public interface JdbcOperations {
* list of arguments to bind to the query, expecting a result object.
* <p>The query is expected to be a single row/single column query; the returned
* result will be directly mapped to the corresponding object type.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param args arguments to bind to the query
* (leaving it to the PreparedStatement to guess the corresponding SQL type);
* may also contain {@link SqlParameterValue} objects which indicate not
@@ -626,7 +626,7 @@ public interface JdbcOperations {
* list of arguments to bind to the query, expecting a result object.
* <p>The query is expected to be a single row/single column query; the returned
* result will be directly mapped to the corresponding object type.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param requiredType the type that the result object is expected to match
* @param args arguments to bind to the query
* (leaving it to the PreparedStatement to guess the corresponding SQL type);
@@ -647,9 +647,9 @@ public interface JdbcOperations {
* list of arguments to bind to the query, expecting a result Map.
* <p>The query is expected to be a single row query; the result row will be
* mapped to a Map (one entry for each column, using the column name as the key).
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param args arguments to bind to the query
* @param argTypes SQL types of the arguments
* @param argTypes the SQL types of the arguments
* (constants from {@code java.sql.Types})
* @return the result Map (one entry for each column, using the
* column name as the key)
@@ -670,7 +670,7 @@ public interface JdbcOperations {
* one of the queryForObject() methods.
* <p>The query is expected to be a single row query; the result row will be
* mapped to a Map (one entry for each column, using the column name as the key).
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param args arguments to bind to the query
* (leaving it to the PreparedStatement to guess the corresponding SQL type);
* may also contain {@link SqlParameterValue} objects which indicate not
@@ -690,9 +690,9 @@ public interface JdbcOperations {
* list of arguments to bind to the query, expecting a result list.
* <p>The results will be mapped to a List (one entry for each row) of
* result objects, each of them matching the specified element type.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param args arguments to bind to the query
* @param argTypes SQL types of the arguments
* @param argTypes the SQL types of the arguments
* (constants from {@code java.sql.Types})
* @param elementType the required type of element in the result list
* (for example, {@code Integer.class})
@@ -709,7 +709,7 @@ public interface JdbcOperations {
* list of arguments to bind to the query, expecting a result list.
* <p>The results will be mapped to a List (one entry for each row) of
* result objects, each of them matching the specified element type.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param args arguments to bind to the query
* (leaving it to the PreparedStatement to guess the corresponding SQL type);
* may also contain {@link SqlParameterValue} objects which indicate not
@@ -728,7 +728,7 @@ public interface JdbcOperations {
* list of arguments to bind to the query, expecting a result list.
* <p>The results will be mapped to a List (one entry for each row) of
* result objects, each of them matching the specified element type.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param elementType the required type of element in the result list
* (for example, {@code Integer.class})
* @param args arguments to bind to the query
@@ -750,9 +750,9 @@ public interface JdbcOperations {
* Maps (one entry for each column, using the column name as the key).
* Thus Each element in the list will be of the form returned by this interface's
* queryForMap() methods.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param args arguments to bind to the query
* @param argTypes SQL types of the arguments
* @param argTypes the SQL types of the arguments
* (constants from {@code java.sql.Types})
* @return a List that contains a Map per row
* @throws DataAccessException if the query fails
@@ -768,7 +768,7 @@ public interface JdbcOperations {
* Maps (one entry for each column, using the column name as the key).
* Each element in the list will be of the form returned by this interface's
* queryForMap() methods.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param args arguments to bind to the query
* (leaving it to the PreparedStatement to guess the corresponding SQL type);
* may also contain {@link SqlParameterValue} objects which indicate not
@@ -788,9 +788,9 @@ public interface JdbcOperations {
* be available at runtime: by default, Sun's {@code com.sun.rowset.CachedRowSetImpl}
* 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 SQL query to execute
* @param sql the SQL query to execute
* @param args arguments to bind to the query
* @param argTypes SQL types of the arguments
* @param argTypes the SQL types of the arguments
* (constants from {@code java.sql.Types})
* @return a SqlRowSet representation (possibly a wrapper around a
* {@code javax.sql.rowset.CachedRowSet})
@@ -811,7 +811,7 @@ public interface JdbcOperations {
* be available at runtime: by default, Sun's {@code com.sun.rowset.CachedRowSetImpl}
* 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 SQL query to execute
* @param sql the SQL query to execute
* @param args arguments to bind to the query
* (leaving it to the PreparedStatement to guess the corresponding SQL type);
* may also contain {@link SqlParameterValue} objects which indicate not
@@ -844,7 +844,7 @@ public interface JdbcOperations {
* with activated extraction of generated keys (a JDBC 3.0 feature). This can
* either be done directly or through using a PreparedStatementCreatorFactory.
* @param psc object that provides SQL and any necessary parameters
* @param generatedKeyHolder KeyHolder that will hold the generated keys
* @param generatedKeyHolder a KeyHolder that will hold the generated keys
* @return the number of rows affected
* @throws DataAccessException if there is any problem issuing the update
* @see PreparedStatementCreatorFactory
@@ -857,7 +857,7 @@ public interface JdbcOperations {
* with given SQL. Simpler than using a PreparedStatementCreator as this method
* will create the PreparedStatement: The PreparedStatementSetter just needs to
* set parameters.
* @param sql SQL containing bind parameters
* @param sql the SQL containing bind parameters
* @param pss helper that sets bind parameters. If this is {@code null}
* we run an update with static SQL.
* @return the number of rows affected
@@ -868,9 +868,9 @@ public interface JdbcOperations {
/**
* Issue a single SQL update operation (such as an insert, update or delete statement)
* via a prepared statement, binding the given arguments.
* @param sql SQL containing bind parameters
* @param sql the SQL containing bind parameters
* @param args arguments to bind to the query
* @param argTypes SQL types of the arguments
* @param argTypes the SQL types of the arguments
* (constants from {@code java.sql.Types})
* @return the number of rows affected
* @throws DataAccessException if there is any problem issuing the update
@@ -881,7 +881,7 @@ public interface JdbcOperations {
/**
* Issue a single SQL update operation (such as an insert, update or delete statement)
* via a prepared statement, binding the given arguments.
* @param sql SQL containing bind parameters
* @param sql the SQL containing bind parameters
* @param args arguments to bind to the query
* (leaving it to the PreparedStatement to guess the corresponding SQL type);
* may also contain {@link SqlParameterValue} objects which indicate not
@@ -917,7 +917,7 @@ public interface JdbcOperations {
* Execute a batch using the supplied SQL statement with the batch of supplied arguments.
* @param sql the SQL statement to execute.
* @param batchArgs the List of Object arrays containing the batch of arguments for the query
* @param argTypes SQL types of the arguments
* @param argTypes the SQL types of the arguments
* (constants from {@code java.sql.Types})
* @return an array containing the numbers of rows affected by each update in the batch
*/
@@ -930,7 +930,7 @@ public interface JdbcOperations {
* @param sql the SQL statement to execute.
* @param batchArgs the List of Object arrays containing the batch of arguments for the query
* @param batchSize batch size
* @param pss ParameterizedPreparedStatementSetter to use
* @param pss the ParameterizedPreparedStatementSetter to use
* @return an array containing for each batch another array containing the numbers of rows affected
* by each update in the batch
*/
@@ -979,7 +979,7 @@ public interface JdbcOperations {
* required parameters.
* @param csc object that provides SQL and any necessary parameters
* @param declaredParameters list of declared SqlParameter objects
* @return Map of extracted out parameters
* @return a Map of extracted out parameters
* @throws DataAccessException if there is any problem issuing the update
*/
Map<String, Object> call(CallableStatementCreator csc, List<SqlParameter> declaredParameters)

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -105,7 +105,7 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
private static final String RETURN_UPDATE_COUNT_PREFIX = "#update-count-";
/** If this variable is false, we will throw exceptions on SQL warnings */
/** If this variable is false, we will throw exceptions on SQL warnings. */
private boolean ignoreWarnings = true;
/**
@@ -399,6 +399,9 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
logger.debug("Executing SQL statement [" + sql + "]");
}
/**
* Callback to execute the statement.
*/
class ExecuteStatementCallback implements StatementCallback<Object>, SqlProvider {
@Override
@Nullable
@@ -424,6 +427,9 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
logger.debug("Executing SQL query [" + sql + "]");
}
/**
* Callback to execute the query.
*/
class QueryStatementCallback implements StatementCallback<T>, SqlProvider {
@Override
@Nullable
@@ -496,6 +502,9 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
logger.debug("Executing SQL update [" + sql + "]");
}
/**
* Callback to execute the update statement.
*/
class UpdateStatementCallback implements StatementCallback<Integer>, SqlProvider {
@Override
public Integer doInStatement(Statement stmt) throws SQLException {
@@ -521,6 +530,9 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
logger.debug("Executing SQL batch update of " + sql.length + " statements");
}
/**
* Callback to execute the batch update.
*/
class BatchUpdateStatementCallback implements StatementCallback<int[]>, SqlProvider {
@Nullable
@@ -638,7 +650,7 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
* Query using a prepared statement, allowing for a PreparedStatementCreator
* and a PreparedStatementSetter. Most other query methods use this method,
* but application code will always work with either a creator or a setter.
* @param psc Callback handler that can create a PreparedStatement given a
* @param psc the Callback handler that can create a PreparedStatement given a
* Connection
* @param pss object that knows how to set values on the prepared statement.
* If this is null, the SQL will be assumed to contain no bind parameters.
@@ -1122,10 +1134,10 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
/**
* Extract returned ResultSets from the completed stored procedure.
* @param cs JDBC wrapper for the stored procedure
* @param updateCountParameters Parameter list of declared update count parameters for the stored procedure
* @param resultSetParameters Parameter list of declared resultSet parameters for the stored procedure
* @return Map that contains returned results
* @param cs a JDBC wrapper for the stored procedure
* @param updateCountParameters the parameter list of declared update count parameters for the stored procedure
* @param resultSetParameters the parameter list of declared resultSet parameters for the stored procedure
* @return a Map that contains returned results
*/
protected Map<String, Object> extractReturnedResults(CallableStatement cs,
@Nullable List<SqlParameter> updateCountParameters, @Nullable List<SqlParameter> resultSetParameters,
@@ -1186,9 +1198,9 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
/**
* Extract output parameters from the completed stored procedure.
* @param cs JDBC wrapper for the stored procedure
* @param cs the JDBC wrapper for the stored procedure
* @param parameters parameter list for the stored procedure
* @return Map that contains returned results
* @return a Map that contains returned results
*/
protected Map<String, Object> extractOutputParameters(CallableStatement cs, List<SqlParameter> parameters)
throws SQLException {
@@ -1235,7 +1247,7 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
* Process the given ResultSet from a stored procedure.
* @param rs the ResultSet to process
* @param param the corresponding stored procedure parameter
* @return Map that contains returned results
* @return a Map that contains returned results
*/
protected Map<String, Object> processResultSet(
@Nullable ResultSet rs, ResultSetSupportingSqlParameter param) throws SQLException {
@@ -1392,7 +1404,7 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
/**
* Translate the given {@link SQLException} into a generic {@link DataAccessException}.
* @param task readable text describing the task being attempted
* @param sql SQL query or update that caused the problem (may be {@code null})
* @param sql the SQL query or update that caused the problem (may be {@code null})
* @param ex the offending {@code SQLException}
* @return a DataAccessException wrapping the {@code SQLException} (never {@code null})
* @since 5.0

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 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.
@@ -35,13 +35,13 @@ public interface ParameterMapper {
/**
* Create a Map of input parameters, keyed by name.
* @param con JDBC connection. This is useful (and the purpose of this interface)
* @param con a JDBC connection. This is useful (and the purpose of this interface)
* if we need to do something RDBMS-specific with a proprietary Connection
* implementation class. This class conceals such proprietary details. However,
* it is best to avoid using such proprietary RDBMS features if possible.
* @return a Map of input parameters, keyed by name (never {@code null})
* @throws SQLException if a SQLException is encountered setting
* parameter values (that is, there's no need to catch SQLException)
* @return Map of input parameters, keyed by name (never {@code null})
*/
Map<String, ?> createMap(Connection con) throws SQLException;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 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.
@@ -35,6 +35,7 @@ import java.sql.SQLException;
* @author Nicolas Fabre
* @author Thomas Risberg
* @since 3.1
* @param <T> the argument type
* @see JdbcTemplate#batchUpdate(String, java.util.Collection, int, ParameterizedPreparedStatementSetter)
*/
@FunctionalInterface

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 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.
@@ -38,6 +38,7 @@ import org.springframework.lang.Nullable;
*
* @author Juergen Hoeller
* @since 16.03.2004
* @param <T> the result type
* @see JdbcTemplate#execute(String, PreparedStatementCallback)
* @see JdbcTemplate#execute(PreparedStatementCreator, PreparedStatementCallback)
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 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.
@@ -46,7 +46,7 @@ public interface PreparedStatementCreator {
/**
* Create a statement in this connection. Allows implementations to use
* PreparedStatements. The JdbcTemplate will close the created statement.
* @param con Connection to use to create statement
* @param con the connection used to create statement
* @return a prepared statement
* @throws SQLException there is no need to catch SQLExceptions
* that may be thrown in the implementation of this method.

View File

@@ -44,10 +44,10 @@ import org.springframework.util.Assert;
*/
public class PreparedStatementCreatorFactory {
/** The SQL, which won't change when the parameters change */
/** The SQL, which won't change when the parameters change. */
private final String sql;
/** List of SqlParameter objects (may not be {@code null}) */
/** List of SqlParameter objects (may not be {@code null}). */
private final List<SqlParameter> declaredParameters;
private int resultSetType = ResultSet.TYPE_FORWARD_ONLY;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 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.
@@ -42,6 +42,7 @@ import org.springframework.lang.Nullable;
* @author Rod Johnson
* @author Juergen Hoeller
* @since April 24, 2003
* @param <T> the result type
* @see JdbcTemplate
* @see RowCallbackHandler
* @see RowMapper
@@ -52,7 +53,7 @@ public interface ResultSetExtractor<T> {
/**
* Implementations must implement this method to process the entire ResultSet.
* @param rs ResultSet to extract data from. Implementations should
* @param rs the ResultSet to extract data from. Implementations should
* not close this: it will be closed by the calling JdbcTemplate.
* @return an arbitrary result object, or {@code null} if none
* (the extractor will typically be stateful in the latter case).

View File

@@ -16,6 +16,8 @@
package org.springframework.jdbc.core;
import java.sql.ResultSet;
import org.springframework.lang.Nullable;
/**
@@ -40,7 +42,7 @@ public class ResultSetSupportingSqlParameter extends SqlParameter {
/**
* Create a new ResultSetSupportingSqlParameter.
* @param name name of the parameter, as used in input and output maps
* @param sqlType SQL type of the parameter according to java.sql.Types
* @param sqlType the parameter SQL type according to {@code java.sql.Types}
*/
public ResultSetSupportingSqlParameter(String name, int sqlType) {
super(name, sqlType);
@@ -49,7 +51,7 @@ public class ResultSetSupportingSqlParameter extends SqlParameter {
/**
* Create a new ResultSetSupportingSqlParameter.
* @param name name of the parameter, as used in input and output maps
* @param sqlType SQL type of the parameter according to java.sql.Types
* @param sqlType the parameter SQL type according to {@code java.sql.Types}
* @param scale the number of digits after the decimal point
* (for DECIMAL and NUMERIC types)
*/
@@ -60,7 +62,7 @@ public class ResultSetSupportingSqlParameter extends SqlParameter {
/**
* Create a new ResultSetSupportingSqlParameter.
* @param name name of the parameter, as used in input and output maps
* @param sqlType SQL type of the parameter according to java.sql.Types
* @param sqlType the parameter SQL type according to {@code java.sql.Types}
* @param typeName the type name of the parameter (optional)
*/
public ResultSetSupportingSqlParameter(String name, int sqlType, @Nullable String typeName) {
@@ -70,8 +72,8 @@ public class ResultSetSupportingSqlParameter extends SqlParameter {
/**
* Create a new ResultSetSupportingSqlParameter.
* @param name name of the parameter, as used in input and output maps
* @param sqlType SQL type of the parameter according to java.sql.Types
* @param rse ResultSetExtractor to use for parsing the ResultSet
* @param sqlType the parameter SQL type according to {@code java.sql.Types}
* @param rse the {@link ResultSetExtractor} to use for parsing the {@link ResultSet}
*/
public ResultSetSupportingSqlParameter(String name, int sqlType, ResultSetExtractor<?> rse) {
super(name, sqlType);
@@ -81,8 +83,8 @@ public class ResultSetSupportingSqlParameter extends SqlParameter {
/**
* Create a new ResultSetSupportingSqlParameter.
* @param name name of the parameter, as used in input and output maps
* @param sqlType SQL type of the parameter according to java.sql.Types
* @param rch RowCallbackHandler to use for parsing the ResultSet
* @param sqlType the parameter SQL type according to {@code java.sql.Types}
* @param rch the {@link RowCallbackHandler} to use for parsing the {@link ResultSet}
*/
public ResultSetSupportingSqlParameter(String name, int sqlType, RowCallbackHandler rch) {
super(name, sqlType);
@@ -92,8 +94,8 @@ public class ResultSetSupportingSqlParameter extends SqlParameter {
/**
* Create a new ResultSetSupportingSqlParameter.
* @param name name of the parameter, as used in input and output maps
* @param sqlType SQL type of the parameter according to java.sql.Types
* @param rm RowMapper to use for parsing the ResultSet
* @param sqlType the parameter SQL type according to {@code java.sql.Types}
* @param rm the {@link RowMapper} to use for parsing the {@link ResultSet}
*/
public ResultSetSupportingSqlParameter(String name, int sqlType, RowMapper<?> rm) {
super(name, sqlType);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -45,10 +45,10 @@ import org.springframework.lang.Nullable;
*/
public class RowCountCallbackHandler implements RowCallbackHandler {
/** Rows we've seen so far */
/** Rows we've seen so far. */
private int rowCount;
/** Columns we've seen so far */
/** Columns we've seen so far. */
private int columnCount;
/**
@@ -91,7 +91,7 @@ public class RowCountCallbackHandler implements RowCallbackHandler {
/**
* Subclasses may override this to perform custom extraction
* or processing. This class's implementation does nothing.
* @param rs ResultSet to extract data from. This method is
* @param rs the ResultSet to extract data from. This method is
* invoked for each row
* @param rowNum number of the current row (starting from 0)
*/
@@ -122,7 +122,7 @@ public class RowCountCallbackHandler implements RowCallbackHandler {
}
/**
* Return the row count of this ResultSet
* Return the row count of this ResultSet.
* Only valid after processing is complete
* @return the number of rows in this ResultSet
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -42,6 +42,7 @@ import org.springframework.lang.Nullable;
*
* @author Thomas Risberg
* @author Juergen Hoeller
* @param <T> the result type
* @see JdbcTemplate
* @see RowCallbackHandler
* @see ResultSetExtractor

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 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.
@@ -53,6 +53,7 @@ import org.springframework.util.Assert;
*
* @author Juergen Hoeller
* @since 1.0.2
* @param <T> the result element type
* @see RowMapper
* @see JdbcTemplate
* @see org.springframework.jdbc.object.MappingSqlQuery

View File

@@ -41,6 +41,7 @@ import org.springframework.util.NumberUtils;
* @author Juergen Hoeller
* @author Kazuki Shimizu
* @since 1.2
* @param <T> the result type
* @see JdbcTemplate#queryForList(String, Class)
* @see JdbcTemplate#queryForObject(String, Class)
*/

View File

@@ -16,6 +16,8 @@
package org.springframework.jdbc.core;
import java.sql.ResultSet;
/**
* Subclass of {@link SqlOutParameter} to represent an INOUT parameter.
* Will return {@code true} for SqlParameter's {@link #isInputValueProvided}
@@ -32,7 +34,7 @@ public class SqlInOutParameter extends SqlOutParameter {
/**
* Create a new SqlInOutParameter.
* @param name name of the parameter, as used in input and output maps
* @param sqlType SQL type of the parameter according to java.sql.Types
* @param sqlType the parameter SQL type according to {@code java.sql.Types}
*/
public SqlInOutParameter(String name, int sqlType) {
super(name, sqlType);
@@ -41,7 +43,7 @@ public class SqlInOutParameter extends SqlOutParameter {
/**
* Create a new SqlInOutParameter.
* @param name name of the parameter, as used in input and output maps
* @param sqlType SQL type of the parameter according to java.sql.Types
* @param sqlType the parameter SQL type according to {@code java.sql.Types}
* @param scale the number of digits after the decimal point
* (for DECIMAL and NUMERIC types)
*/
@@ -52,7 +54,7 @@ public class SqlInOutParameter extends SqlOutParameter {
/**
* Create a new SqlInOutParameter.
* @param name name of the parameter, as used in input and output maps
* @param sqlType SQL type of the parameter according to java.sql.Types
* @param sqlType the parameter SQL type according to {@code java.sql.Types}
* @param typeName the type name of the parameter (optional)
*/
public SqlInOutParameter(String name, int sqlType, String typeName) {
@@ -62,7 +64,7 @@ public class SqlInOutParameter extends SqlOutParameter {
/**
* Create a new SqlInOutParameter.
* @param name name of the parameter, as used in input and output maps
* @param sqlType SQL type of the parameter according to java.sql.Types
* @param sqlType the parameter SQL type according to {@code java.sql.Types}
* @param typeName the type name of the parameter (optional)
* @param sqlReturnType custom value handler for complex type (optional)
*/
@@ -73,8 +75,8 @@ public class SqlInOutParameter extends SqlOutParameter {
/**
* Create a new SqlInOutParameter.
* @param name name of the parameter, as used in input and output maps
* @param sqlType SQL type of the parameter according to java.sql.Types
* @param rse ResultSetExtractor to use for parsing the ResultSet
* @param sqlType the parameter SQL type according to {@code java.sql.Types}
* @param rse the {@link ResultSetExtractor} to use for parsing the {@link ResultSet}
*/
public SqlInOutParameter(String name, int sqlType, ResultSetExtractor<?> rse) {
super(name, sqlType, rse);
@@ -83,8 +85,8 @@ public class SqlInOutParameter extends SqlOutParameter {
/**
* Create a new SqlInOutParameter.
* @param name name of the parameter, as used in input and output maps
* @param sqlType SQL type of the parameter according to java.sql.Types
* @param rch RowCallbackHandler to use for parsing the ResultSet
* @param sqlType the parameter SQL type according to {@code java.sql.Types}
* @param rch the {@link RowCallbackHandler} to use for parsing the {@link ResultSet}
*/
public SqlInOutParameter(String name, int sqlType, RowCallbackHandler rch) {
super(name, sqlType, rch);
@@ -93,8 +95,8 @@ public class SqlInOutParameter extends SqlOutParameter {
/**
* Create a new SqlInOutParameter.
* @param name name of the parameter, as used in input and output maps
* @param sqlType SQL type of the parameter according to java.sql.Types
* @param rm RowMapper to use for parsing the ResultSet
* @param sqlType the parameter SQL type according to {@code java.sql.Types}
* @param rm the {@link RowMapper} to use for parsing the {@link ResultSet}
*/
public SqlInOutParameter(String name, int sqlType, RowMapper<?> rm) {
super(name, sqlType, rm);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -16,6 +16,8 @@
package org.springframework.jdbc.core;
import java.sql.ResultSet;
import org.springframework.lang.Nullable;
/**
@@ -39,7 +41,7 @@ public class SqlOutParameter extends ResultSetSupportingSqlParameter {
/**
* Create a new SqlOutParameter.
* @param name name of the parameter, as used in input and output maps
* @param sqlType SQL type of the parameter according to java.sql.Types
* @param sqlType the parameter SQL type according to {@code java.sql.Types}
*/
public SqlOutParameter(String name, int sqlType) {
super(name, sqlType);
@@ -48,7 +50,7 @@ public class SqlOutParameter extends ResultSetSupportingSqlParameter {
/**
* Create a new SqlOutParameter.
* @param name name of the parameter, as used in input and output maps
* @param sqlType SQL type of the parameter according to java.sql.Types
* @param sqlType the parameter SQL type according to {@code java.sql.Types}
* @param scale the number of digits after the decimal point
* (for DECIMAL and NUMERIC types)
*/
@@ -59,7 +61,7 @@ public class SqlOutParameter extends ResultSetSupportingSqlParameter {
/**
* Create a new SqlOutParameter.
* @param name name of the parameter, as used in input and output maps
* @param sqlType SQL type of the parameter according to java.sql.Types
* @param sqlType the parameter SQL type according to {@code java.sql.Types}
* @param typeName the type name of the parameter (optional)
*/
public SqlOutParameter(String name, int sqlType, @Nullable String typeName) {
@@ -69,7 +71,7 @@ public class SqlOutParameter extends ResultSetSupportingSqlParameter {
/**
* Create a new SqlOutParameter.
* @param name name of the parameter, as used in input and output maps
* @param sqlType SQL type of the parameter according to java.sql.Types
* @param sqlType the parameter SQL type according to {@code java.sql.Types}
* @param typeName the type name of the parameter (optional)
* @param sqlReturnType custom value handler for complex type (optional)
*/
@@ -81,8 +83,8 @@ public class SqlOutParameter extends ResultSetSupportingSqlParameter {
/**
* Create a new SqlOutParameter.
* @param name name of the parameter, as used in input and output maps
* @param sqlType SQL type of the parameter according to java.sql.Types
* @param rse ResultSetExtractor to use for parsing the ResultSet
* @param sqlType the parameter SQL type according to {@code java.sql.Types}
* @param rse the {@link ResultSetExtractor} to use for parsing the {@link ResultSet}
*/
public SqlOutParameter(String name, int sqlType, ResultSetExtractor<?> rse) {
super(name, sqlType, rse);
@@ -91,8 +93,8 @@ public class SqlOutParameter extends ResultSetSupportingSqlParameter {
/**
* Create a new SqlOutParameter.
* @param name name of the parameter, as used in input and output maps
* @param sqlType SQL type of the parameter according to java.sql.Types
* @param rch RowCallbackHandler to use for parsing the ResultSet
* @param sqlType the parameter SQL type according to {@code java.sql.Types}
* @param rch the {@link RowCallbackHandler} to use for parsing the {@link ResultSet}
*/
public SqlOutParameter(String name, int sqlType, RowCallbackHandler rch) {
super(name, sqlType, rch);
@@ -100,9 +102,9 @@ public class SqlOutParameter extends ResultSetSupportingSqlParameter {
/**
* Create a new SqlOutParameter.
* @param name name of the parameter, as used in input and output maps
* @param sqlType SQL type of the parameter according to java.sql.Types
* @param rm RowMapper to use for parsing the ResultSet
* @param name the name of the parameter, as used in input and output maps
* @param sqlType the parameter SQL type according to {@code java.sql.Types}
* @param rm the {@link RowMapper} to use for parsing the {@link ResultSet}
*/
public SqlOutParameter(String name, int sqlType, RowMapper<?> rm) {
super(name, sqlType, rm);

View File

@@ -54,7 +54,7 @@ public class SqlParameter {
/**
* Create a new anonymous SqlParameter, supplying the SQL type.
* @param sqlType SQL type of the parameter according to {@code java.sql.Types}
* @param sqlType the SQL type of the parameter according to {@code java.sql.Types}
*/
public SqlParameter(int sqlType) {
this.sqlType = sqlType;
@@ -62,7 +62,7 @@ public class SqlParameter {
/**
* Create a new anonymous SqlParameter, supplying the SQL type.
* @param sqlType SQL type of the parameter according to {@code java.sql.Types}
* @param sqlType the SQL type of the parameter according to {@code java.sql.Types}
* @param typeName the type name of the parameter (optional)
*/
public SqlParameter(int sqlType, @Nullable String typeName) {
@@ -72,7 +72,7 @@ public class SqlParameter {
/**
* Create a new anonymous SqlParameter, supplying the SQL type.
* @param sqlType SQL type of the parameter according to {@code java.sql.Types}
* @param sqlType the SQL type of the parameter according to {@code java.sql.Types}
* @param scale the number of digits after the decimal point
* (for DECIMAL and NUMERIC types)
*/
@@ -84,7 +84,7 @@ public class SqlParameter {
/**
* Create a new SqlParameter, supplying name and SQL type.
* @param name name of the parameter, as used in input and output maps
* @param sqlType SQL type of the parameter according to {@code java.sql.Types}
* @param sqlType the SQL type of the parameter according to {@code java.sql.Types}
*/
public SqlParameter(String name, int sqlType) {
this.name = name;
@@ -94,7 +94,7 @@ public class SqlParameter {
/**
* Create a new SqlParameter, supplying name and SQL type.
* @param name name of the parameter, as used in input and output maps
* @param sqlType SQL type of the parameter according to {@code java.sql.Types}
* @param sqlType the SQL type of the parameter according to {@code java.sql.Types}
* @param typeName the type name of the parameter (optional)
*/
public SqlParameter(String name, int sqlType, @Nullable String typeName) {
@@ -106,7 +106,7 @@ public class SqlParameter {
/**
* Create a new SqlParameter, supplying name and SQL type.
* @param name name of the parameter, as used in input and output maps
* @param sqlType SQL type of the parameter according to {@code java.sql.Types}
* @param sqlType the SQL type of the parameter according to {@code java.sql.Types}
* @param scale the number of digits after the decimal point
* (for DECIMAL and NUMERIC types)
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -44,7 +44,7 @@ public class SqlParameterValue extends SqlParameter {
/**
* Create a new SqlParameterValue, supplying the SQL type.
* @param sqlType SQL type of the parameter according to {@code java.sql.Types}
* @param sqlType the SQL type of the parameter according to {@code java.sql.Types}
* @param value the value object
*/
public SqlParameterValue(int sqlType, @Nullable Object value) {
@@ -54,7 +54,7 @@ public class SqlParameterValue extends SqlParameter {
/**
* Create a new SqlParameterValue, supplying the SQL type.
* @param sqlType SQL type of the parameter according to {@code java.sql.Types}
* @param sqlType the SQL type of the parameter according to {@code java.sql.Types}
* @param typeName the type name of the parameter (optional)
* @param value the value object
*/
@@ -65,7 +65,7 @@ public class SqlParameterValue extends SqlParameter {
/**
* Create a new SqlParameterValue, supplying the SQL type.
* @param sqlType SQL type of the parameter according to {@code java.sql.Types}
* @param sqlType the SQL type of the parameter according to {@code java.sql.Types}
* @param scale the number of digits after the decimal point
* (for DECIMAL and NUMERIC types)
* @param value the value object

View File

@@ -33,7 +33,7 @@ public class SqlReturnResultSet extends ResultSetSupportingSqlParameter {
/**
* Create a new instance of the {@link SqlReturnResultSet} class.
* @param name name of the parameter, as used in input and output maps
* @param extractor ResultSetExtractor to use for parsing the {@link java.sql.ResultSet}
* @param extractor the {@link ResultSetExtractor} to use for parsing the {@link java.sql.ResultSet}
*/
public SqlReturnResultSet(String name, ResultSetExtractor<?> extractor) {
super(name, 0, extractor);
@@ -42,7 +42,7 @@ public class SqlReturnResultSet extends ResultSetSupportingSqlParameter {
/**
* Create a new instance of the {@link SqlReturnResultSet} class.
* @param name name of the parameter, as used in input and output maps
* @param handler RowCallbackHandler to use for parsing the {@link java.sql.ResultSet}
* @param handler the {@link RowCallbackHandler} to use for parsing the {@link java.sql.ResultSet}
*/
public SqlReturnResultSet(String name, RowCallbackHandler handler) {
super(name, 0, handler);
@@ -51,7 +51,7 @@ public class SqlReturnResultSet extends ResultSetSupportingSqlParameter {
/**
* Create a new instance of the {@link SqlReturnResultSet} class.
* @param name name of the parameter, as used in input and output maps
* @param mapper RowMapper to use for parsing the {@link java.sql.ResultSet}
* @param mapper the {@link RowMapper} to use for parsing the {@link java.sql.ResultSet}
*/
public SqlReturnResultSet(String name, RowMapper<?> mapper) {
super(name, 0, mapper);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -53,7 +53,7 @@ public interface SqlReturnType {
* Get the type value from the specific object.
* @param cs the CallableStatement to operate on
* @param paramIndex the index of the parameter for which we need to set the value
* @param sqlType SQL type of the parameter we are setting
* @param sqlType the SQL type of the parameter we are setting
* @param typeName the type name of the parameter (optional)
* @return the target value
* @throws SQLException if a SQLException is encountered setting parameter values

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -57,7 +57,7 @@ public interface SqlTypeValue {
* Set the type value on the given PreparedStatement.
* @param ps the PreparedStatement to work on
* @param paramIndex the index of the parameter for which we need to set the value
* @param sqlType SQL type of the parameter we are setting
* @param sqlType the SQL type of the parameter we are setting
* @param typeName the type name of the parameter (optional)
* @throws SQLException if a SQLException is encountered while setting parameter values
* @see java.sql.Types

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 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.
@@ -32,6 +32,7 @@ import org.springframework.lang.Nullable;
*
* @author Juergen Hoeller
* @since 16.03.2004
* @param <T> the result type
* @see JdbcTemplate#execute(StatementCallback)
*/
@FunctionalInterface

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -166,7 +166,7 @@ public interface CallMetaDataProvider {
/**
* Get the call parameter meta-data that is currently used.
* @return List of {@link CallParameterMetaData}
* @return a List of {@link CallParameterMetaData}
*/
List<CallParameterMetaData> getCallParameterMetaData();

View File

@@ -37,7 +37,7 @@ import org.springframework.jdbc.support.MetaDataAccessException;
*/
public class CallMetaDataProviderFactory {
/** List of supported database products for procedure calls */
/** List of supported database products for procedure calls. */
public static final List<String> supportedDatabaseProductsForProcedures = Arrays.asList(
"Apache Derby",
"DB2",
@@ -48,7 +48,7 @@ public class CallMetaDataProviderFactory {
"Sybase"
);
/** List of supported database products for function calls */
/** List of supported database products for function calls. */
public static final List<String> supportedDatabaseProductsForFunctions = Arrays.asList(
"MySQL",
"Microsoft SQL Server",

View File

@@ -43,7 +43,7 @@ import org.springframework.util.StringUtils;
*/
public class GenericCallMetaDataProvider implements CallMetaDataProvider {
/** Logger available to subclasses */
/** Logger available to subclasses. */
protected static final Log logger = LogFactory.getLog(CallMetaDataProvider.class);
private boolean procedureColumnMetaDataUsed = false;

View File

@@ -43,37 +43,37 @@ import org.springframework.lang.Nullable;
*/
public class GenericTableMetaDataProvider implements TableMetaDataProvider {
/** Logger available to subclasses */
/** Logger available to subclasses. */
protected static final Log logger = LogFactory.getLog(TableMetaDataProvider.class);
/** indicator whether column meta-data should be used */
/** indicator whether column meta-data should be used. */
private boolean tableColumnMetaDataUsed = false;
/** the version of the database */
/** the version of the database. */
@Nullable
private String databaseVersion;
/** the name of the user currently connected */
/** the name of the user currently connected. */
@Nullable
private String userName;
/** indicates whether the identifiers are uppercased */
/** indicates whether the identifiers are uppercased. */
private boolean storesUpperCaseIdentifiers = true;
/** indicates whether the identifiers are lowercased */
/** indicates whether the identifiers are lowercased. */
private boolean storesLowerCaseIdentifiers = false;
/** indicates whether generated keys retrieval is supported */
/** indicates whether generated keys retrieval is supported. */
private boolean getGeneratedKeysSupported = true;
/** indicates whether the use of a String[] for generated keys is supported */
/** indicates whether the use of a String[] for generated keys is supported. */
private boolean generatedKeysColumnNameArraySupported = true;
/** database products we know not supporting the use of a String[] for generated keys */
/** database products we know not supporting the use of a String[] for generated keys. */
private List<String> productsNotSupportingGeneratedKeysColumnNameArray =
Arrays.asList("Apache Derby", "HSQL Database Engine");
/** Collection of TableParameterMetaData objects */
/** Collection of TableParameterMetaData objects. */
private List<TableParameterMetaData> tableParameterMetaData = new ArrayList<>();
@@ -381,7 +381,7 @@ public class GenericTableMetaDataProvider implements TableMetaDataProvider {
}
/**
* Method supporting the meta-data processing for a table's columns
* Method supporting the meta-data processing for a table's columns.
*/
private void processTableColumns(DatabaseMetaData databaseMetaData, TableMetaData tmd) {
ResultSet tableColumns = null;

View File

@@ -265,7 +265,7 @@ public class TableMetaDataContext {
/**
* Build the insert string based on configuration and meta-data information
* Build the insert string based on configuration and meta-data information.
* @return the insert string to be used
*/
public String createInsertString(String... generatedKeyNames) {
@@ -361,6 +361,9 @@ public class TableMetaDataContext {
}
/**
* Does this database support a simple query to retrieve generated keys
* when the JDBC 3.0 feature is not supported:
* {@link java.sql.DatabaseMetaData#supportsGetGeneratedKeys()}?
* @deprecated as of 4.3.15, in favor of {@link #getSimpleQueryForGetGeneratedKey}
*/
@Deprecated

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -119,7 +119,7 @@ public interface TableMetaDataProvider {
/**
* Get the table parameter meta-data that is currently used.
* @return List of {@link TableParameterMetaData}
* @return a List of {@link TableParameterMetaData}
*/
List<TableParameterMetaData> getTableParameterMetaData();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -62,7 +62,7 @@ public interface NamedParameterJdbcOperations {
* and converting JDBC SQLExceptions into Spring's DataAccessException hierarchy.
* <p>The callback action can return a result object, for example a
* domain object or a collection of domain objects.
* @param sql SQL to execute
* @param sql the SQL to execute
* @param paramSource container of arguments to bind to the query
* @param action callback object that specifies the action
* @return a result object returned by the action, or {@code null}
@@ -80,7 +80,7 @@ public interface NamedParameterJdbcOperations {
* and converting JDBC SQLExceptions into Spring's DataAccessException hierarchy.
* <p>The callback action can return a result object, for example a
* domain object or a collection of domain objects.
* @param sql SQL to execute
* @param sql the SQL to execute
* @param paramMap map of parameters to bind to the query
* (leaving it to the PreparedStatement to guess the corresponding SQL type)
* @param action callback object that specifies the action
@@ -99,7 +99,7 @@ public interface NamedParameterJdbcOperations {
* and converting JDBC SQLExceptions into Spring's DataAccessException hierarchy.
* <p>The callback action can return a result object, for example a
* domain object or a collection of domain objects.
* @param sql SQL to execute
* @param sql the SQL to execute
* @param action callback object that specifies the action
* @return a result object returned by the action, or {@code null}
* @throws DataAccessException if there is any problem
@@ -111,7 +111,7 @@ public interface NamedParameterJdbcOperations {
* Query given SQL to create a prepared statement from SQL and a list
* of arguments to bind to the query, reading the ResultSet with a
* ResultSetExtractor.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param paramSource container of arguments to bind to the query
* @param rse object that will extract results
* @return an arbitrary result object, as returned by the ResultSetExtractor
@@ -125,7 +125,7 @@ public interface NamedParameterJdbcOperations {
* Query given SQL to create a prepared statement from SQL and a list
* of arguments to bind to the query, reading the ResultSet with a
* ResultSetExtractor.
* @param sql SQL query to execute
* @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)
* @param rse object that will extract results
@@ -142,7 +142,7 @@ public interface NamedParameterJdbcOperations {
* <p>Note: In contrast to the JdbcOperations method with the same signature,
* this query variant always uses a PreparedStatement. It is effectively
* equivalent to a query call with an empty parameter Map.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param rse object that will extract results
* @return an arbitrary result object, as returned by the ResultSetExtractor
* @throws org.springframework.dao.DataAccessException if the query fails
@@ -154,7 +154,7 @@ public interface NamedParameterJdbcOperations {
* Query given SQL to create a prepared statement from SQL and a list of
* arguments to bind to the query, reading the ResultSet on a per-row basis
* with a RowCallbackHandler.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param paramSource container of arguments to bind to the query
* @param rch object that will extract results, one row at a time
* @throws DataAccessException if the query fails
@@ -166,7 +166,7 @@ public interface NamedParameterJdbcOperations {
* Query given SQL to create a prepared statement from SQL and a list of
* arguments to bind to the query, reading the ResultSet on a per-row basis
* with a RowCallbackHandler.
* @param sql SQL query to execute
* @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)
* @param rch object that will extract results, one row at a time
@@ -180,7 +180,7 @@ public interface NamedParameterJdbcOperations {
* <p>Note: In contrast to the JdbcOperations method with the same signature,
* this query variant always uses a PreparedStatement. It is effectively
* equivalent to a query call with an empty parameter Map.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param rch object that will extract results, one row at a time
* @throws org.springframework.dao.DataAccessException if the query fails
*/
@@ -190,7 +190,7 @@ public interface NamedParameterJdbcOperations {
* Query given SQL to create a prepared statement from SQL and a list
* of arguments to bind to the query, mapping each row to a Java object
* via a RowMapper.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param paramSource container of arguments to bind to the query
* @param rowMapper object that will map one object per row
* @return the result List, containing mapped objects
@@ -203,7 +203,7 @@ public interface NamedParameterJdbcOperations {
* Query given SQL to create a prepared statement from SQL and a list
* of arguments to bind to the query, mapping each row to a Java object
* via a RowMapper.
* @param sql SQL query to execute
* @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)
* @param rowMapper object that will map one object per row
@@ -219,7 +219,7 @@ public interface NamedParameterJdbcOperations {
* <p>Note: In contrast to the JdbcOperations method with the same signature,
* this query variant always uses a PreparedStatement. It is effectively
* equivalent to a query call with an empty parameter Map.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param rowMapper object that will map one object per row
* @return the result List, containing mapped objects
* @throws org.springframework.dao.DataAccessException if the query fails
@@ -230,7 +230,7 @@ public interface NamedParameterJdbcOperations {
* Query given SQL to create a prepared statement from SQL and a list
* of arguments to bind to the query, mapping a single result row to a
* Java object via a RowMapper.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param paramSource container of arguments to bind to the query
* @param rowMapper object that will map one object per row
* @return the single mapped object (may be {@code null} if the given
@@ -248,7 +248,7 @@ public interface NamedParameterJdbcOperations {
* Query given SQL to create a prepared statement from SQL and a list
* of arguments to bind to the query, mapping a single result row to a
* Java object via a RowMapper.
* @param sql SQL query to execute
* @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)
* @param rowMapper object that will map one object per row
@@ -268,7 +268,7 @@ public interface NamedParameterJdbcOperations {
* list of arguments to bind to the query, expecting a result object.
* <p>The query is expected to be a single row/single column query; the returned
* result will be directly mapped to the corresponding object type.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param paramSource container of arguments to bind to the query
* @param requiredType the type that the result object is expected to match
* @return the result object of the required type, or {@code null} in case of SQL NULL
@@ -287,7 +287,7 @@ public interface NamedParameterJdbcOperations {
* list of arguments to bind to the query, expecting a result object.
* <p>The query is expected to be a single row/single column query; the returned
* result will be directly mapped to the corresponding object type.
* @param sql SQL query to execute
* @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)
* @param requiredType the type that the result object is expected to match
@@ -307,7 +307,7 @@ public interface NamedParameterJdbcOperations {
* list of arguments to bind to the query, expecting a result Map.
* <p>The query is expected to be a single row query; the result row will be
* mapped to a Map (one entry for each column, using the column name as the key).
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param paramSource container of arguments to bind to the query
* @return the result Map (one entry for each column, using the column name as the key)
* @throws org.springframework.dao.IncorrectResultSizeDataAccessException
@@ -326,7 +326,7 @@ public interface NamedParameterJdbcOperations {
* one of the queryForObject() methods.
* <p>The query is expected to be a single row query; the result row will be
* mapped to a Map (one entry for each column, using the column name as the key).
* @param sql SQL query to execute
* @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 the result Map (one entry for each column, using the column name as the key)
@@ -343,7 +343,7 @@ public interface NamedParameterJdbcOperations {
* list of arguments to bind to the query, expecting a result list.
* <p>The results will be mapped to a List (one entry for each row) of
* result objects, each of them matching the specified element type.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param paramSource container of arguments to bind to the query
* @param elementType the required type of element in the result list
* (for example, {@code Integer.class})
@@ -360,7 +360,7 @@ public interface NamedParameterJdbcOperations {
* list of arguments to bind to the query, expecting a result list.
* <p>The results will be mapped to a List (one entry for each row) of
* result objects, each of them matching the specified element type.
* @param sql SQL query to execute
* @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)
* @param elementType the required type of element in the result list
@@ -380,7 +380,7 @@ public interface NamedParameterJdbcOperations {
* Maps (one entry for each column, using the column name as the key).
* Each element in the list will be of the form returned by this interface's
* {@code queryForMap} methods.
* @param sql SQL query to execute
* @param sql the SQL query to execute
* @param paramSource container of arguments to bind to the query
* @return a List that contains a Map per row
* @throws org.springframework.dao.DataAccessException if the query fails
@@ -395,7 +395,7 @@ public interface NamedParameterJdbcOperations {
* Maps (one entry for each column, using the column name as the key).
* Each element in the list will be of the form returned by this interface's
* {@code queryForMap} methods.
* @param sql SQL query to execute
* @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 List that contains a Map per row
@@ -413,7 +413,7 @@ public interface NamedParameterJdbcOperations {
* be available at runtime: by default, Sun's {@code com.sun.rowset.CachedRowSetImpl}
* 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 SQL query to execute
* @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
* {@code javax.sql.rowset.CachedRowSet})
@@ -433,7 +433,7 @@ public interface NamedParameterJdbcOperations {
* be available at runtime: by default, Sun's {@code com.sun.rowset.CachedRowSetImpl}
* 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 SQL query to execute
* @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
@@ -447,7 +447,7 @@ public interface NamedParameterJdbcOperations {
/**
* Issue an update via a prepared statement, binding the given arguments.
* @param sql SQL containing named parameters
* @param sql the SQL containing named parameters
* @param paramSource container of arguments and SQL types to bind to the query
* @return the number of rows affected
* @throws org.springframework.dao.DataAccessException if there is any problem issuing the update
@@ -456,7 +456,7 @@ public interface NamedParameterJdbcOperations {
/**
* Issue an update via a prepared statement, binding the given arguments.
* @param sql SQL containing named parameters
* @param sql the SQL containing named parameters
* @param paramMap map of parameters to bind to the query
* (leaving it to the PreparedStatement to guess the corresponding SQL type)
* @return the number of rows affected
@@ -467,9 +467,9 @@ public interface NamedParameterJdbcOperations {
/**
* Issue an update via a prepared statement, binding the given arguments,
* returning generated keys.
* @param sql SQL containing named parameters
* @param sql the SQL containing named parameters
* @param paramSource container of arguments and SQL types to bind to the query
* @param generatedKeyHolder KeyHolder that will hold the generated keys
* @param generatedKeyHolder a {@link KeyHolder} that will hold the generated keys
* @return the number of rows affected
* @throws org.springframework.dao.DataAccessException if there is any problem issuing the update
* @see MapSqlParameterSource
@@ -481,9 +481,9 @@ public interface NamedParameterJdbcOperations {
/**
* Issue an update via a prepared statement, binding the given arguments,
* returning generated keys.
* @param sql SQL containing named parameters
* @param sql the SQL containing named parameters
* @param paramSource container of arguments and SQL types to bind to the query
* @param generatedKeyHolder KeyHolder that will hold the generated keys
* @param generatedKeyHolder a {@link KeyHolder} that will hold the generated keys
* @param keyColumnNames names of the columns that will have keys generated for them
* @return the number of rows affected
* @throws org.springframework.dao.DataAccessException if there is any problem issuing the update

View File

@@ -64,16 +64,16 @@ import org.springframework.util.Assert;
*/
public class NamedParameterJdbcTemplate implements NamedParameterJdbcOperations {
/** Default maximum number of entries for this template's SQL cache: 256 */
/** Default maximum number of entries for this template's SQL cache: 256. */
public static final int DEFAULT_CACHE_LIMIT = 256;
/** The JdbcTemplate we are wrapping */
/** The JdbcTemplate we are wrapping. */
private final JdbcOperations classicJdbcTemplate;
private volatile int cacheLimit = DEFAULT_CACHE_LIMIT;
/** Cache of original SQL String to ParsedSql representation */
/** Cache of original SQL String to ParsedSql representation. */
@SuppressWarnings("serial")
private final Map<String, ParsedSql> parsedSqlCache =
new LinkedHashMap<String, ParsedSql>(DEFAULT_CACHE_LIMIT, 0.75f, true) {

View File

@@ -202,7 +202,7 @@ public abstract class NamedParameterUtils {
}
/**
* Skip over comments and quoted names present in an SQL statement
* Skip over comments and quoted names present in an SQL statement.
* @param statement character array containing SQL statement
* @param position current position of statement
* @return next position to process after any comments or quotes are skipped

View File

@@ -50,19 +50,19 @@ import org.springframework.util.StringUtils;
*/
public abstract class AbstractJdbcCall {
/** Logger available to subclasses */
/** Logger available to subclasses. */
protected final Log logger = LogFactory.getLog(getClass());
/** Lower-level class used to execute SQL */
/** Lower-level class used to execute SQL. */
private final JdbcTemplate jdbcTemplate;
/** Context used to retrieve and manage database meta-data */
/** Context used to retrieve and manage database meta-data. */
private final CallMetaDataContext callMetaDataContext = new CallMetaDataContext();
/** List of SqlParameter objects */
/** List of SqlParameter objects. */
private final List<SqlParameter> declaredParameters = new ArrayList<>();
/** List of RefCursor/ResultSet RowMapper objects */
/** List of RefCursor/ResultSet RowMapper objects. */
private final Map<String, RowMapper<?>> declaredRowMappers = new LinkedHashMap<>();
/**
@@ -71,7 +71,7 @@ public abstract class AbstractJdbcCall {
*/
private volatile boolean compiled = false;
/** The generated string used for call statement */
/** The generated string used for call statement. */
@Nullable
private String callString;
@@ -231,7 +231,7 @@ public abstract class AbstractJdbcCall {
}
/**
* Get the {@link CallableStatementCreatorFactory} being used
* Get the {@link CallableStatementCreatorFactory} being used.
*/
protected CallableStatementCreatorFactory getCallableStatementFactory() {
Assert.state(this.callableStatementFactory != null, "No CallableStatementCreatorFactory available");
@@ -365,7 +365,7 @@ public abstract class AbstractJdbcCall {
/**
* Delegate method that executes the call using the passed-in {@link SqlParameterSource}.
* @param parameterSource parameter names and values to be used in call
* @return Map of out parameters
* @return a Map of out parameters
*/
protected Map<String, Object> doExecute(SqlParameterSource parameterSource) {
checkCompiled();
@@ -377,7 +377,7 @@ public abstract class AbstractJdbcCall {
* Delegate method that executes the call using the passed-in array of parameters.
* @param args array of parameter values. The order of values must match the order
* declared for the stored procedure.
* @return Map of out parameters
* @return a Map of out parameters
*/
protected Map<String, Object> doExecute(Object... args) {
checkCompiled();
@@ -387,8 +387,8 @@ public abstract class AbstractJdbcCall {
/**
* Delegate method that executes the call using the passed-in Map of parameters.
* @param args Map of parameter name and values
* @return Map of out parameters
* @param args a Map of parameter name and values
* @return a Map of out parameters
*/
protected Map<String, Object> doExecute(Map<String, ?> args) {
checkCompiled();
@@ -435,7 +435,7 @@ public abstract class AbstractJdbcCall {
* Match the provided in parameter values with registered parameters and
* parameters defined via meta-data processing.
* @param parameterSource the parameter vakues provided as a {@link SqlParameterSource}
* @return Map with parameter names and values
* @return a Map with parameter names and values
*/
protected Map<String, Object> matchInParameterValuesWithCallParameters(SqlParameterSource parameterSource) {
return this.callMetaDataContext.matchInParameterValuesWithCallParameters(parameterSource);
@@ -445,7 +445,7 @@ public abstract class AbstractJdbcCall {
* Match the provided in parameter values with registered parameters and
* parameters defined via meta-data processing.
* @param args the parameter values provided as an array
* @return Map with parameter names and values
* @return a Map with parameter names and values
*/
private Map<String, ?> matchInParameterValuesWithCallParameters(Object[] args) {
return this.callMetaDataContext.matchInParameterValuesWithCallParameters(args);
@@ -455,7 +455,7 @@ public abstract class AbstractJdbcCall {
* Match the provided in parameter values with registered parameters and
* parameters defined via meta-data processing.
* @param args the parameter values provided in a Map
* @return Map with parameter names and values
* @return a Map with parameter names and values
*/
protected Map<String, ?> matchInParameterValuesWithCallParameters(Map<String, ?> args) {
return this.callMetaDataContext.matchInParameterValuesWithCallParameters(args);

View File

@@ -60,19 +60,19 @@ import org.springframework.util.Assert;
*/
public abstract class AbstractJdbcInsert {
/** Logger available to subclasses */
/** Logger available to subclasses. */
protected final Log logger = LogFactory.getLog(getClass());
/** Lower-level class used to execute SQL */
/** Lower-level class used to execute SQL. */
private final JdbcTemplate jdbcTemplate;
/** Context used to retrieve and manage database meta-data */
/** Context used to retrieve and manage database meta-data. */
private final TableMetaDataContext tableMetaDataContext = new TableMetaDataContext();
/** List of columns objects to be used in insert statement */
/** List of columns objects to be used in insert statement. */
private final List<String> declaredColumns = new ArrayList<>();
/** The names of the columns holding the generated key */
/** The names of the columns holding the generated key. */
private String[] generatedKeyNames = new String[0];
/**
@@ -81,10 +81,10 @@ public abstract class AbstractJdbcInsert {
*/
private volatile boolean compiled = false;
/** The generated string used for insert statement */
/** The generated string used for insert statement. */
private String insertString = "";
/** The SQL type information for the insert columns */
/** The SQL type information for the insert columns. */
private int[] insertTypes = new int[0];
@@ -327,7 +327,7 @@ public abstract class AbstractJdbcInsert {
/**
* Delegate method that executes the insert using the passed-in Map of parameters.
* @param args Map with parameter names and values to be used in insert
* @param args a Map with parameter names and values to be used in insert
* @return the number of rows affected
*/
protected int doExecute(Map<String, ?> args) {
@@ -360,7 +360,7 @@ public abstract class AbstractJdbcInsert {
/**
* Method that provides execution of the insert using the passed-in
* Map of parameters and returning a generated key.
* @param args Map with parameter names and values to be used in insert
* @param args a Map with parameter names and values to be used in insert
* @return the key generated by the insert
*/
protected Number doExecuteAndReturnKey(Map<String, ?> args) {
@@ -384,7 +384,7 @@ public abstract class AbstractJdbcInsert {
/**
* Method that provides execution of the insert using the passed-in
* Map of parameters and returning all generated keys.
* @param args Map with parameter names and values to be used in insert
* @param args a Map with parameter names and values to be used in insert
* @return the KeyHolder containing keys generated by the insert
*/
protected KeyHolder doExecuteAndReturnKeyHolder(Map<String, ?> args) {
@@ -548,7 +548,7 @@ public abstract class AbstractJdbcInsert {
}
/**
* Delegate method that executes a batch insert using the passed-in {@link SqlParameterSource}s.
* Delegate method that executes a batch insert using the passed-in {@link SqlParameterSource SqlParameterSources}.
* @param batch array of SqlParameterSource with parameter names and values to be used in insert
* @return array of number of rows affected
*/
@@ -582,7 +582,7 @@ public abstract class AbstractJdbcInsert {
}
/**
* Internal implementation for setting parameter values
* Internal implementation for setting parameter values.
* @param preparedStatement the PreparedStatement
* @param values the values to be set
*/
@@ -605,7 +605,7 @@ public abstract class AbstractJdbcInsert {
* Match the provided in parameter values with registered parameters and parameters
* defined via meta-data processing.
* @param parameterSource the parameter values provided as a {@link SqlParameterSource}
* @return Map with parameter names and values
* @return a Map with parameter names and values
*/
protected List<Object> matchInParameterValuesWithInsertColumns(SqlParameterSource parameterSource) {
return this.tableMetaDataContext.matchInParameterValuesWithInsertColumns(parameterSource);
@@ -615,7 +615,7 @@ public abstract class AbstractJdbcInsert {
* Match the provided in parameter values with registered parameters and parameters
* defined via meta-data processing.
* @param args the parameter values provided in a Map
* @return Map with parameter names and values
* @return a Map with parameter names and values
*/
protected List<Object> matchInParameterValuesWithInsertColumns(Map<String, ?> args) {
return this.tableMetaDataContext.matchInParameterValuesWithInsertColumns(args);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2018 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.
@@ -81,7 +81,7 @@ public interface SimpleJdbcCallOperations {
*/
SimpleJdbcCallOperations declareParameters(SqlParameter... sqlParameters);
/** Not used yet */
/** Not used yet. */
SimpleJdbcCallOperations useInParameterNames(String... inParameterNames);
/**
@@ -123,7 +123,7 @@ public interface SimpleJdbcCallOperations {
* Execute the stored function and return the results obtained as an Object of the
* specified return type.
* @param returnType the type of the value to return
* @param args Map containing the parameter values to be used in the call
* @param args a Map containing the parameter values to be used in the call
*/
<T> T executeFunction(Class<T> returnType, Map<String, ?> args);
@@ -131,7 +131,7 @@ public interface SimpleJdbcCallOperations {
* Execute the stored function and return the results obtained as an Object of the
* specified return type.
* @param returnType the type of the value to return
* @param args MapSqlParameterSource containing the parameter values to be used in the call
* @param args the MapSqlParameterSource containing the parameter values to be used in the call
*/
<T> T executeFunction(Class<T> returnType, SqlParameterSource args);
@@ -151,7 +151,7 @@ public interface SimpleJdbcCallOperations {
* of the specified return type. In the case where there are multiple out parameters,
* the first one is returned and additional out parameters are ignored.
* @param returnType the type of the value to return
* @param args Map containing the parameter values to be used in the call
* @param args a Map containing the parameter values to be used in the call
*/
<T> T executeObject(Class<T> returnType, Map<String, ?> args);
@@ -160,7 +160,7 @@ public interface SimpleJdbcCallOperations {
* of the specified return type. In the case where there are multiple out parameters,
* the first one is returned and additional out parameters are ignored.
* @param returnType the type of the value to return
* @param args MapSqlParameterSource containing the parameter values to be used in the call
* @param args the MapSqlParameterSource containing the parameter values to be used in the call
*/
<T> T executeObject(Class<T> returnType, SqlParameterSource args);
@@ -170,23 +170,23 @@ public interface SimpleJdbcCallOperations {
* @param args optional array containing the in parameter values to be used in the call.
* Parameter values must be provided in the same order as the parameters are defined for
* the stored procedure.
* @return Map of output params
* @return a Map of output params
*/
Map<String, Object> execute(Object... args);
/**
* Execute the stored procedure and return a map of output params, keyed by name
* as in parameter declarations.
* @param args Map containing the parameter values to be used in the call
* @return Map of output params
* @param args a Map containing the parameter values to be used in the call
* @return a Map of output params
*/
Map<String, Object> execute(Map<String, ?> args);
/**
* Execute the stored procedure and return a map of output params, keyed by name
* as in parameter declarations.
* @param args SqlParameterSource containing the parameter values to be used in the call
* @return Map of output params
* @param args the SqlParameterSource containing the parameter values to be used in the call
* @return a Map of output params
*/
Map<String, Object> execute(SqlParameterSource args);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -83,14 +83,14 @@ public interface SimpleJdbcInsertOperations {
/**
* Execute the insert using the values passed in.
* @param args Map containing column names and corresponding value
* @param args a Map containing column names and corresponding value
* @return the number of rows affected as returned by the JDBC driver
*/
int execute(Map<String, ?> args);
/**
* Execute the insert using the values passed in.
* @param parameterSource SqlParameterSource containing values to use for insert
* @param parameterSource the SqlParameterSource containing values to use for insert
* @return the number of rows affected as returned by the JDBC driver
*/
int execute(SqlParameterSource parameterSource);
@@ -100,7 +100,7 @@ public interface SimpleJdbcInsertOperations {
* <p>This requires that the name of the columns with auto generated keys have been specified.
* This method will always return a KeyHolder but the caller must verify that it actually
* contains the generated keys.
* @param args Map containing column names and corresponding value
* @param args a Map containing column names and corresponding value
* @return the generated key value
*/
Number executeAndReturnKey(Map<String, ?> args);
@@ -110,7 +110,7 @@ public interface SimpleJdbcInsertOperations {
* <p>This requires that the name of the columns with auto generated keys have been specified.
* This method will always return a KeyHolder but the caller must verify that it actually
* contains the generated keys.
* @param parameterSource SqlParameterSource containing values to use for insert
* @param parameterSource the SqlParameterSource containing values to use for insert
* @return the generated key value.
*/
Number executeAndReturnKey(SqlParameterSource parameterSource);
@@ -120,7 +120,7 @@ public interface SimpleJdbcInsertOperations {
* <p>This requires that the name of the columns with auto generated keys have been specified.
* This method will always return a KeyHolder but the caller must verify that it actually
* contains the generated keys.
* @param args Map containing column names and corresponding value
* @param args a Map containing column names and corresponding value
* @return the KeyHolder containing all generated keys
*/
KeyHolder executeAndReturnKeyHolder(Map<String, ?> args);
@@ -130,7 +130,7 @@ public interface SimpleJdbcInsertOperations {
* <p>This requires that the name of the columns with auto generated keys have been specified.
* This method will always return a KeyHolder but the caller must verify that it actually
* contains the generated keys.
* @param parameterSource SqlParameterSource containing values to use for insert
* @param parameterSource the SqlParameterSource containing values to use for insert
* @return the KeyHolder containing all generated keys
*/
KeyHolder executeAndReturnKeyHolder(SqlParameterSource parameterSource);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2018 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.
@@ -66,7 +66,7 @@ public abstract class AbstractInterruptibleBatchPreparedStatementSetter
/**
* Check for available values and set them on the given PreparedStatement.
* If no values are available anymore, return {@code false}.
* @param ps PreparedStatement we'll invoke setter methods on
* @param ps the PreparedStatement we'll invoke setter methods on
* @param i index of the statement we're issuing in the batch, starting from 0
* @return whether there were values to apply (that is, whether the applied
* parameters should be added to the batch and this method should be called

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2018 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.
@@ -51,6 +51,7 @@ import org.springframework.lang.Nullable;
*
* @author Juergen Hoeller
* @since 1.0.2
* @param <T> the result type
* @see org.springframework.jdbc.support.lob.LobHandler
* @see org.springframework.jdbc.LobRetrievalFailureException
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -69,7 +69,7 @@ public abstract class AbstractSqlTypeValue implements SqlTypeValue {
/**
* Create the type value to be passed into {@code PreparedStatement.setObject}.
* @param con the JDBC Connection, if needed to create any database-specific objects
* @param sqlType SQL type of the parameter we are setting
* @param sqlType the SQL type of the parameter we are setting
* @param typeName the type name of the parameter
* @return the type value
* @throws SQLException if a SQLException is encountered setting

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -94,7 +94,7 @@ public class JdbcBeanDefinitionReader {
/**
* Load bean definitions from the database via the given SQL string.
* @param sql SQL query to use for loading bean definitions.
* @param sql the SQL query to use for loading bean definitions.
* The first three columns must be bean name, property name and value.
* Any join and any other columns are permitted: e.g.
* {@code SELECT BEAN_NAME, PROPERTY, VALUE FROM CONFIG WHERE CONFIG.APP_ID = 1}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -144,7 +144,7 @@ public abstract class JdbcDaoSupport extends DaoSupport {
/**
* Close the given JDBC Connection, created via this DAO's DataSource,
* if it isn't bound to the thread.
* @param con Connection to close
* @param con the Connection to close
* @see org.springframework.jdbc.datasource.DataSourceUtils#releaseConnection
*/
protected final void releaseConnection(Connection con) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2018 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.
@@ -38,7 +38,7 @@ import org.apache.commons.logging.LogFactory;
*/
public abstract class AbstractDataSource implements DataSource {
/** Logger available to subclasses */
/** Logger available to subclasses. */
protected final Log logger = LogFactory.getLog(getClass());

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -41,6 +41,9 @@ import org.springframework.util.Assert;
*/
public class ConnectionHolder extends ResourceHolderSupport {
/**
* Prefix of savpoint names.
*/
public static final String SAVEPOINT_NAME_PREFIX = "SAVEPOINT_";

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -129,7 +129,7 @@ public class DataSourceTransactionManager extends AbstractPlatformTransactionMan
/**
* Create a new DataSourceTransactionManager instance.
* @param dataSource JDBC DataSource to manage transactions for
* @param dataSource the JDBC DataSource to manage transactions for
*/
public DataSourceTransactionManager(DataSource dataSource) {
this();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -99,7 +99,7 @@ public class DriverManagerDataSource extends AbstractDriverBasedDataSource {
* Create a new DriverManagerDataSource with the given JDBC URL,
* not specifying a username or password for JDBC access.
* @param url the JDBC URL to use for accessing the DriverManager
* @param conProps JDBC connection properties
* @param conProps the JDBC connection properties
* @see java.sql.DriverManager#getConnection(String)
*/
public DriverManagerDataSource(String url, Properties conProps) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -55,7 +55,7 @@ import org.springframework.transaction.support.TransactionSynchronizationManager
*/
public class IsolationLevelDataSourceAdapter extends UserCredentialsDataSourceAdapter {
/** Constants instance for TransactionDefinition */
/** Constants instance for TransactionDefinition. */
private static final Constants constants = new Constants(TransactionDefinition.class);
@Nullable

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -78,7 +78,7 @@ import org.springframework.lang.Nullable;
*/
public class LazyConnectionDataSourceProxy extends DelegatingDataSource {
/** Constants instance for TransactionDefinition */
/** Constants instance for TransactionDefinition. */
private static final Constants constants = new Constants(Connection.class);
private static final Log logger = LogFactory.getLog(LazyConnectionDataSourceProxy.class);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -93,7 +93,7 @@ public class SimpleDriverDataSource extends AbstractDriverBasedDataSource {
* Create a new DriverManagerDataSource with the given standard Driver parameters.
* @param driver the JDBC Driver object
* @param url the JDBC URL to use for accessing the DriverManager
* @param conProps JDBC connection properties
* @param conProps the JDBC connection properties
* @see java.sql.Driver#connect(String, java.util.Properties)
*/
public SimpleDriverDataSource(Driver driver, String url, Properties conProps) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -54,22 +54,22 @@ import org.springframework.util.ObjectUtils;
*/
public class SingleConnectionDataSource extends DriverManagerDataSource implements SmartDataSource, DisposableBean {
/** Create a close-suppressing proxy? */
/** Create a close-suppressing proxy?. */
private boolean suppressClose;
/** Override auto-commit state? */
/** Override auto-commit state?. */
@Nullable
private Boolean autoCommit;
/** Wrapped Connection */
/** Wrapped Connection. */
@Nullable
private Connection target;
/** Proxy Connection */
/** Proxy Connection. */
@Nullable
private Connection connection;
/** Synchronization monitor for the shared Connection */
/** Synchronization monitor for the shared Connection. */
private final Object connectionMonitor = new Object();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -124,7 +124,7 @@ public class TransactionAwareDataSourceProxy extends DelegatingDataSource {
/**
* Wraps the given Connection with a proxy that delegates every method call to it
* but delegates {@code close()} calls to DataSourceUtils.
* @param targetDataSource DataSource that the Connection came from
* @param targetDataSource the DataSource that the Connection came from
* @return the wrapped Connection
* @see java.sql.Connection#close()
* @see DataSourceUtils#doReleaseConnection

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2018 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.
@@ -88,8 +88,8 @@ public class EmbeddedDatabaseBuilder {
* <p>Enabling this flag overrides any explicit name set via {@link #setName}.
* @param flag {@code true} if a unique database name should be generated
* @return {@code this}, to facilitate method chaining
* @see #setName
* @since 4.2
* @see #setName
*/
public EmbeddedDatabaseBuilder generateUniqueName(boolean flag) {
this.databaseFactory.setGenerateUniqueDatabaseName(flag);

View File

@@ -31,7 +31,7 @@ final class EmbeddedDatabaseConfigurerFactory {
/**
* Return a configurer instance for the given embedded database type.
* @param type HSQL, H2 or Derby
* @param type the embedded database type (HSQL, H2 or Derby)
* @return the configurer instance
* @throws IllegalStateException if the driver for the specified database type is not available
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -64,7 +64,7 @@ import org.springframework.util.Assert;
public class EmbeddedDatabaseFactory {
/**
* Default name for an embedded database: {@value}
* Default name for an embedded database: {@value}.
*/
public static final String DEFAULT_DATABASE_NAME = "testdb";
@@ -91,8 +91,8 @@ public class EmbeddedDatabaseFactory {
* generation of a pseudo-random unique ID to be used as the database name.
* <p>Setting this flag to {@code true} overrides any explicit name set
* via {@link #setDatabaseName}.
* @see #setDatabaseName
* @since 4.2
* @see #setDatabaseName
*/
public void setGenerateUniqueDatabaseName(boolean generateUniqueDatabaseName) {
this.generateUniqueDatabaseName = generateUniqueDatabaseName;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2018 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.
@@ -25,13 +25,13 @@ package org.springframework.jdbc.datasource.embedded;
*/
public enum EmbeddedDatabaseType {
/** The Hypersonic Embedded Java SQL Database (http://hsqldb.org) */
/** The <a href="http://hsqldb.org">Hypersonic</a> Embedded Java SQL Database. */
HSQL,
/** The H2 Embedded Java SQL Database Engine (http://h2database.com) */
/** The <a href="http://h2database.com">H2</a> Embedded Java SQL Database Engine. */
H2,
/** The Apache Derby Embedded SQL Database (http://db.apache.org/derby) */
/** The <a href="http://db.apache.org/derby">Apache Derby</a> Embedded SQL Database. */
DERBY
}

View File

@@ -339,7 +339,7 @@ public abstract class ScriptUtils {
/**
* Does the provided SQL script contain the specified delimiter?
* @param script the SQL script
* @param delim String delimiting each statement - typically a ';' character
* @param delim the string delimiting each statement - typically a ';' character
*/
public static boolean containsSqlScriptDelimiters(String script, String delim) {
boolean inLiteral = false;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2010 the original author or authors.
* Copyright 2002-2018 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.
@@ -92,7 +92,7 @@ import org.springframework.transaction.support.TransactionSynchronizationManager
*/
public class IsolationLevelDataSourceRouter extends AbstractRoutingDataSource {
/** Constants instance for TransactionDefinition */
/** Constants instance for TransactionDefinition. */
private static final Constants constants = new Constants(TransactionDefinition.class);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 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.
@@ -72,8 +72,8 @@ public class BatchSqlUpdate extends SqlUpdate {
/**
* Construct an update object with a given DataSource and SQL.
* @param ds DataSource to use to obtain connections
* @param sql SQL statement to execute
* @param ds the DataSource to use to obtain connections
* @param sql the SQL statement to execute
*/
public BatchSqlUpdate(DataSource ds, String sql) {
super(ds, sql);
@@ -82,9 +82,9 @@ public class BatchSqlUpdate extends SqlUpdate {
/**
* Construct an update object with a given DataSource, SQL
* and anonymous parameters.
* @param ds DataSource to use to obtain connections
* @param sql SQL statement to execute
* @param types SQL types of the parameters, as defined in the
* @param ds the DataSource to use to obtain connections
* @param sql the SQL statement to execute
* @param types the SQL types of the parameters, as defined in the
* {@code java.sql.Types} class
* @see java.sql.Types
*/
@@ -96,9 +96,9 @@ public class BatchSqlUpdate extends SqlUpdate {
* Construct an update object with a given DataSource, SQL,
* anonymous parameters and specifying the maximum number of rows
* that may be affected.
* @param ds DataSource to use to obtain connections
* @param sql SQL statement to execute
* @param types SQL types of the parameters, as defined in the
* @param ds the DataSource to use to obtain connections
* @param sql the SQL statement to execute
* @param types the SQL types of the parameters, as defined in the
* {@code java.sql.Types} class
* @param batchSize the number of statements that will trigger
* an automatic intermediate flush

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -30,6 +30,7 @@ import org.springframework.util.Assert;
* @author Thomas Risberg
* @author Juergen Hoeller
* @since 3.0
* @param <T> the result type
* @see #setRowMapper
* @see #setRowMapperClass
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -35,6 +35,7 @@ import org.springframework.lang.Nullable;
* @author Rod Johnson
* @author Thomas Risberg
* @author Jean-Pierre Pawlak
* @param <T> the result type
* @see MappingSqlQueryWithParameters
*/
public abstract class MappingSqlQuery<T> extends MappingSqlQueryWithParameters<T> {
@@ -47,8 +48,8 @@ public abstract class MappingSqlQuery<T> extends MappingSqlQueryWithParameters<T
/**
* Convenient constructor with DataSource and SQL string.
* @param ds DataSource to use to obtain connections
* @param sql SQL to run
* @param ds the DataSource to use to obtain connections
* @param sql the SQL to run
*/
public MappingSqlQuery(DataSource ds, String sql) {
super(ds, sql);
@@ -74,7 +75,7 @@ public abstract class MappingSqlQuery<T> extends MappingSqlQueryWithParameters<T
* <p>Subclasses of this class, as opposed to direct subclasses of
* MappingSqlQueryWithParameters, don't need to concern themselves
* with the parameters to the execute method of the query object.
* @param rs ResultSet we're working through
* @param rs the ResultSet we're working through
* @param rowNum row number (from 0) we're up to
* @return an object of the result type
* @throws SQLException if there's an error extracting data.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -46,21 +46,22 @@ import org.springframework.lang.Nullable;
* @author Rod Johnson
* @author Thomas Risberg
* @author Jean-Pierre Pawlak
* @param <T> the result type
* @see org.springframework.jdbc.object.MappingSqlQuery
* @see org.springframework.jdbc.object.SqlQuery
*/
public abstract class MappingSqlQueryWithParameters<T> extends SqlQuery<T> {
/**
* Constructor to allow use as a JavaBean
* Constructor to allow use as a JavaBean.
*/
public MappingSqlQueryWithParameters() {
}
/**
* Convenient constructor with DataSource and SQL string.
* @param ds DataSource to use to get connections
* @param sql SQL to run
* @param ds the DataSource to use to get connections
* @param sql the SQL to run
*/
public MappingSqlQueryWithParameters(DataSource ds, String sql) {
super(ds, sql);
@@ -79,7 +80,7 @@ public abstract class MappingSqlQueryWithParameters<T> extends SqlQuery<T> {
/**
* Subclasses must implement this method to convert each row
* of the ResultSet into an object of the result type.
* @param rs ResultSet we're working through
* @param rs the ResultSet we're working through
* @param rowNum row number (from 0) we're up to
* @param parameters to the query (passed to the execute() method).
* Subclasses are rarely interested in these.

View File

@@ -60,10 +60,10 @@ import org.springframework.util.Assert;
*/
public abstract class RdbmsOperation implements InitializingBean {
/** Logger available to subclasses */
/** Logger available to subclasses. */
protected final Log logger = LogFactory.getLog(getClass());
/** Lower-level class used to execute SQL */
/** Lower-level class used to execute SQL. */
private JdbcTemplate jdbcTemplate = new JdbcTemplate();
private int resultSetType = ResultSet.TYPE_FORWARD_ONLY;
@@ -297,7 +297,7 @@ public abstract class RdbmsOperation implements InitializingBean {
* Add one or more declared parameters. Used for configuring this operation
* when used in a bean factory. Each parameter will specify SQL type and (optionally)
* the parameter's name.
* @param parameters Array containing the declared {@link SqlParameter} objects
* @param parameters an array containing the declared {@link SqlParameter} objects
* @see #declaredParameters
*/
public void setParameters(SqlParameter... parameters) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -83,8 +83,8 @@ public abstract class SqlCall extends RdbmsOperation {
/**
* Create a new SqlCall object with SQL, but without parameters.
* Must add parameters or settle with none.
* @param ds DataSource to obtain connections from
* @param sql SQL to execute
* @param ds the DataSource to obtain connections from
* @param sql the SQL to execute
*/
public SqlCall(DataSource ds, String sql) {
setDataSource(ds);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 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.
@@ -46,6 +46,7 @@ import org.springframework.lang.Nullable;
* @author Rod Johnson
* @author Juergen Hoeller
* @author Jean-Pierre Pawlak
* @param <T> the result type
* @see StoredProcedure
*/
public class SqlFunction<T> extends MappingSqlQuery<T> {
@@ -68,8 +69,8 @@ public class SqlFunction<T> extends MappingSqlQuery<T> {
/**
* Create a new SqlFunction object with SQL, but without parameters.
* Must add parameters or settle with none.
* @param ds DataSource to obtain connections from
* @param sql SQL to execute
* @param ds the DataSource to obtain connections from
* @param sql the SQL to execute
*/
public SqlFunction(DataSource ds, String sql) {
setRowsExpected(1);
@@ -79,9 +80,9 @@ public class SqlFunction<T> extends MappingSqlQuery<T> {
/**
* Create a new SqlFunction object with SQL and parameters.
* @param ds DataSource to obtain connections from
* @param sql SQL to execute
* @param types SQL types of the parameters, as defined in the
* @param ds the DataSource to obtain connections from
* @param sql the SQL to execute
* @param types the SQL types of the parameters, as defined in the
* {@code java.sql.Types} class
* @see java.sql.Types
*/
@@ -94,9 +95,9 @@ public class SqlFunction<T> extends MappingSqlQuery<T> {
/**
* Create a new SqlFunction object with SQL, parameters and a result type.
* @param ds DataSource to obtain connections from
* @param sql SQL to execute
* @param types SQL types of the parameters, as defined in the
* @param ds the DataSource to obtain connections from
* @param sql the SQL to execute
* @param types the SQL types of the parameters, as defined in the
* {@code java.sql.Types} class
* @param resultType the type that the result object is required to match
* @see #setResultType(Class)

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -43,11 +43,11 @@ public abstract class SqlOperation extends RdbmsOperation {
@Nullable
private PreparedStatementCreatorFactory preparedStatementFactory;
/** Parsed representation of the SQL statement */
/** Parsed representation of the SQL statement. */
@Nullable
private ParsedSql cachedSql;
/** Monitor for locking the cached representation of the parsed SQL statement */
/** Monitor for locking the cached representation of the parsed SQL statement. */
private final Object parsedSqlMonitor = new Object();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -51,6 +51,7 @@ import org.springframework.lang.Nullable;
* @author Rod Johnson
* @author Juergen Hoeller
* @author Thomas Risberg
* @param <T> the result type
* @see SqlUpdate
*/
public abstract class SqlQuery<T> extends SqlOperation {
@@ -333,7 +334,7 @@ public abstract class SqlQuery<T> extends SqlOperation {
/**
* Generic object finder method for named parameters.
* @param paramMap Map of parameter name to parameter object,
* @param paramMap a Map of parameter name to parameter object,
* matching named parameters specified in the SQL statement.
* Ordering is not significant.
* @param context contextual information passed to the {@code mapRow}
@@ -350,7 +351,7 @@ public abstract class SqlQuery<T> extends SqlOperation {
/**
* Convenient method to execute without context.
* @param paramMap Map of parameter name to parameter object,
* @param paramMap a Map of parameter name to parameter object,
* matching named parameters specified in the SQL statement.
* Ordering is not significant.
*/
@@ -362,7 +363,7 @@ public abstract class SqlQuery<T> extends SqlOperation {
/**
* Subclasses must implement this method to extract an object per row, to be
* returned by the <cod>execute</code> method as an aggregated {@link List}.
* returned by the {@code execute} method as an aggregated {@link List}.
* @param parameters the parameters to the {@code execute()} method,
* in case subclass is interested; may be {@code null} if there
* were no parameters.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -73,8 +73,8 @@ public class SqlUpdate extends SqlOperation {
/**
* Constructs an update object with a given DataSource and SQL.
* @param ds DataSource to use to obtain connections
* @param sql SQL statement to execute
* @param ds the DataSource to use to obtain connections
* @param sql the SQL statement to execute
*/
public SqlUpdate(DataSource ds, String sql) {
setDataSource(ds);
@@ -84,9 +84,9 @@ public class SqlUpdate extends SqlOperation {
/**
* Construct an update object with a given DataSource, SQL
* and anonymous parameters.
* @param ds DataSource to use to obtain connections
* @param sql SQL statement to execute
* @param types SQL types of the parameters, as defined in the
* @param ds the DataSource to use to obtain connections
* @param sql the SQL statement to execute
* @param types the SQL types of the parameters, as defined in the
* {@code java.sql.Types} class
* @see java.sql.Types
*/
@@ -100,9 +100,9 @@ public class SqlUpdate extends SqlOperation {
* Construct an update object with a given DataSource, SQL,
* anonymous parameters and specifying the maximum number of rows
* that may be affected.
* @param ds DataSource to use to obtain connections
* @param sql SQL statement to execute
* @param types SQL types of the parameters, as defined in the
* @param ds the DataSource to use to obtain connections
* @param sql the SQL statement to execute
* @param types the SQL types of the parameters, as defined in the
* {@code java.sql.Types} class
* @param maxRowsAffected the maximum number of rows that may
* be affected by the update
@@ -174,7 +174,7 @@ public class SqlUpdate extends SqlOperation {
* Method to execute the update given arguments and
* retrieve the generated keys using a KeyHolder.
* @param params array of parameter objects
* @param generatedKeyHolder KeyHolder that will hold the generated keys
* @param generatedKeyHolder the KeyHolder that will hold the generated keys
* @return the number of rows affected by the update
*/
public int update(Object[] params, KeyHolder generatedKeyHolder) throws DataAccessException {
@@ -242,7 +242,7 @@ public class SqlUpdate extends SqlOperation {
/**
* Generic method to execute the update given named parameters.
* All other update methods invoke this method.
* @param paramMap Map of parameter name to parameter object,
* @param paramMap a Map of parameter name to parameter object,
* matching named parameters specified in the SQL statement
* @return the number of rows affected by the update
*/
@@ -260,9 +260,9 @@ public class SqlUpdate extends SqlOperation {
/**
* Method to execute the update given arguments and
* retrieve the generated keys using a KeyHolder.
* @param paramMap Map of parameter name to parameter object,
* @param paramMap a Map of parameter name to parameter object,
* matching named parameters specified in the SQL statement
* @param generatedKeyHolder KeyHolder that will hold the generated keys
* @param generatedKeyHolder the KeyHolder that will hold the generated keys
* @return the number of rows affected by the update
*/
public int updateByNamedParam(Map<String, ?> paramMap, KeyHolder generatedKeyHolder) throws DataAccessException {

View File

@@ -47,7 +47,7 @@ public abstract class StoredProcedure extends SqlCall {
/**
* Create a new object wrapper for a stored procedure.
* @param ds DataSource to use throughout the lifetime
* @param ds the DataSource to use throughout the lifetime
* of this object to obtain connections
* @param name name of the stored procedure in the database
*/
@@ -58,7 +58,7 @@ public abstract class StoredProcedure extends SqlCall {
/**
* Create a new object wrapper for a stored procedure.
* @param jdbcTemplate JdbcTemplate which wraps DataSource
* @param jdbcTemplate the JdbcTemplate which wraps DataSource
* @param name name of the stored procedure in the database
*/
protected StoredProcedure(JdbcTemplate jdbcTemplate, String name) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -33,12 +33,13 @@ import org.springframework.lang.Nullable;
* and a DataSource. SQL will often vary between subclasses.
*
* @author Thomas Risberg
* @param <T> the result type
* @see org.springframework.jdbc.object.SqlQuery
*/
public abstract class UpdatableSqlQuery<T> extends SqlQuery<T> {
/**
* Constructor to allow use as a JavaBean
* Constructor to allow use as a JavaBean.
*/
public UpdatableSqlQuery() {
setUpdatableResults(true);
@@ -46,8 +47,8 @@ public abstract class UpdatableSqlQuery<T> extends SqlQuery<T> {
/**
* Convenient constructor with DataSource and SQL string.
* @param ds DataSource to use to get connections
* @param sql SQL to run
* @param ds the DataSource to use to get connections
* @param sql the SQL to run
*/
public UpdatableSqlQuery(DataSource ds, String sql) {
super(ds, sql);
@@ -67,7 +68,7 @@ public abstract class UpdatableSqlQuery<T> extends SqlQuery<T> {
/**
* Subclasses must implement this method to update each row of the
* ResultSet and optionally create object of the result type.
* @param rs ResultSet we're working through
* @param rs the ResultSet we're working through
* @param rowNum row number (from 0) we're up to
* @param context passed to the execute() method.
* It can be {@code null} if no contextual information is need. If you

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -36,7 +36,7 @@ import org.springframework.util.Assert;
*/
public abstract class AbstractFallbackSQLExceptionTranslator implements SQLExceptionTranslator {
/** Logger available to subclasses */
/** Logger available to subclasses. */
protected final Log logger = LogFactory.getLog(getClass());
@Nullable
@@ -95,7 +95,7 @@ public abstract class AbstractFallbackSQLExceptionTranslator implements SQLExcep
* is allowed to return {@code null} to indicate that no exception match has
* been found and that fallback translation should kick in.
* @param task readable text describing the task being attempted
* @param sql SQL query or update that caused the problem (if known)
* @param sql the SQL query or update that caused the problem (if known)
* @param ex the offending {@code SQLException}
* @return the DataAccessException, wrapping the {@code SQLException};
* or {@code null} if no exception match found

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -42,8 +42,14 @@ import org.springframework.lang.Nullable;
*/
public class DatabaseStartupValidator implements InitializingBean {
/**
* The default interval.
*/
public static final int DEFAULT_INTERVAL = 1;
/**
* The default timeout.
*/
public static final int DEFAULT_TIMEOUT = 60;

View File

@@ -39,7 +39,7 @@ import org.springframework.util.Assert;
*/
public abstract class JdbcAccessor implements InitializingBean {
/** Logger available to subclasses */
/** Logger available to subclasses. */
protected final Log logger = LogFactory.getLog(getClass());
@Nullable

View File

@@ -446,9 +446,9 @@ public abstract class JdbcUtils {
* expressed in the JDBC 4.0 specification:
* <p><i>columnLabel - the label for the column specified with the SQL AS clause.
* If the SQL AS clause was not specified, then the label is the name of the column</i>.
* @return the column name to use
* @param resultSetMetaData the current meta-data to use
* @param columnIndex the index of the column for the look up
* @return the column name to use
* @throws SQLException in case of lookup failure
*/
public static String lookupColumnName(ResultSetMetaData resultSetMetaData, int columnIndex) throws SQLException {

View File

@@ -73,7 +73,7 @@ public class SQLErrorCodeSQLExceptionTranslator extends AbstractFallbackSQLExcep
private static final int MESSAGE_SQL_SQLEX_CONSTRUCTOR = 5;
/** Error codes used by this translator */
/** Error codes used by this translator. */
@Nullable
private SQLErrorCodes sqlErrorCodes;
@@ -90,7 +90,7 @@ public class SQLErrorCodeSQLExceptionTranslator extends AbstractFallbackSQLExcep
* Create a SQL error code translator for the given DataSource.
* Invoking this constructor will cause a Connection to be obtained
* from the DataSource to get the meta-data.
* @param dataSource DataSource to use to find meta-data and establish
* @param dataSource the DataSource to use to find meta-data and establish
* which error codes are usable
* @see SQLErrorCodesFactory
*/
@@ -127,7 +127,7 @@ public class SQLErrorCodeSQLExceptionTranslator extends AbstractFallbackSQLExcep
* Set the DataSource for this translator.
* <p>Setting this property will cause a Connection to be obtained from
* the DataSource to get the meta-data.
* @param dataSource DataSource to use to find meta-data and establish
* @param dataSource the DataSource to use to find meta-data and establish
* which error codes are usable
* @see SQLErrorCodesFactory#getErrorCodes(javax.sql.DataSource)
* @see java.sql.DatabaseMetaData#getDatabaseProductName()
@@ -291,7 +291,7 @@ public class SQLErrorCodeSQLExceptionTranslator extends AbstractFallbackSQLExcep
* Subclasses can override this method to attempt a custom mapping from SQLException
* to DataAccessException.
* @param task readable text describing the task being attempted
* @param sql SQL query or update that caused the problem. May be {@code null}.
* @param sql the SQL query or update that caused the problem. May be {@code null}.
* @param sqlEx the offending SQLException
* @return null if no custom translation was possible, otherwise a DataAccessException
* resulting from custom translation. This exception should include the sqlEx parameter
@@ -307,7 +307,7 @@ public class SQLErrorCodeSQLExceptionTranslator extends AbstractFallbackSQLExcep
* Create a custom DataAccessException, based on a given exception
* class from a CustomSQLErrorCodesTranslation definition.
* @param task readable text describing the task being attempted
* @param sql SQL query or update that caused the problem. May be {@code null}.
* @param sql the SQL query or update that caused the problem. May be {@code null}.
* @param sqlEx the offending SQLException
* @param exceptionClass the exception class to use, as defined in the
* CustomSQLErrorCodesTranslation definition

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -46,7 +46,7 @@ public interface SQLExceptionTranslator {
* check (and subsequent cast) is considered reliable when expecting JDBC-based
* access to have happened.
* @param task readable text describing the task being attempted
* @param sql SQL query or update that caused the problem (if known)
* @param sql the SQL query or update that caused the problem (if known)
* @param ex the offending {@code SQLException}
* @return the DataAccessException wrapping the {@code SQLException},
* or {@code null} if no translation could be applied

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2018 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.
@@ -30,10 +30,10 @@ import org.springframework.util.Assert;
*/
public abstract class AbstractColumnMaxValueIncrementer extends AbstractDataFieldMaxValueIncrementer {
/** The name of the column for this sequence */
/** The name of the column for this sequence. */
private String columnName;
/** The number of keys buffered in a cache */
/** The number of keys buffered in a cache. */
private int cacheSize = 1;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2018 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.
@@ -36,10 +36,10 @@ public abstract class AbstractDataFieldMaxValueIncrementer implements DataFieldM
private DataSource dataSource;
/** The name of the sequence/table containing the sequence */
/** The name of the sequence/table containing the sequence. */
private String incrementerName;
/** The length to which a string result should be pre-pended with zeroes */
/** The length to which a string result should be pre-pended with zeroes. */
protected int paddingLength = 0;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2018 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.
@@ -39,10 +39,10 @@ public abstract class AbstractIdentityColumnMaxValueIncrementer extends Abstract
private boolean deleteSpecificValues = false;
/** The current cache of values */
/** The current cache of values. */
private long[] valueCache;
/** The next id to serve from the value cache */
/** The next id to serve from the value cache. */
private int nextValueIndex = -1;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2018 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.
@@ -55,10 +55,10 @@ import javax.sql.DataSource;
*/
public class DerbyMaxValueIncrementer extends AbstractIdentityColumnMaxValueIncrementer {
/** The default for dummy name */
/** The default for dummy name. */
private static final String DEFAULT_DUMMY_NAME = "dummy";
/** The name of the dummy column used for inserts */
/** The name of the dummy column used for inserts. */
private String dummyName = DEFAULT_DUMMY_NAME;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -58,16 +58,16 @@ import org.springframework.jdbc.support.JdbcUtils;
*/
public class MySQLMaxValueIncrementer extends AbstractColumnMaxValueIncrementer {
/** The SQL string for retrieving the new sequence value */
/** The SQL string for retrieving the new sequence value. */
private static final String VALUE_SQL = "select last_insert_id()";
/** The next id to serve */
/** The next id to serve. */
private long nextId = 0;
/** The max id to serve */
/** The max id to serve. */
private long maxId = 0;
/** Whether or not to use a new connection for the incrementer */
/** Whether or not to use a new connection for the incrementer. */
private boolean useNewConnection = true;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 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.
@@ -32,7 +32,7 @@ import org.springframework.jdbc.InvalidResultSetAccessException;
/**
* The default implementation of Spring's {@link SqlRowSet} interface, wrapping a
* {@link java.sql.ResultSet}, catching any {@link SQLException}s and translating
* {@link java.sql.ResultSet}, catching any {@link SQLException java.sql.ResultSet}, catching any {@link SQLExceptions} and translating
* them to a corresponding Spring {@link InvalidResultSetAccessException}.
*
* <p>The passed-in ResultSet should already be disconnected if the SqlRowSet is supposed
@@ -63,7 +63,7 @@ import org.springframework.jdbc.InvalidResultSetAccessException;
*/
public class ResultSetWrappingSqlRowSet implements SqlRowSet {
/** use serialVersionUID from Spring 1.2 for interoperability */
/** use serialVersionUID from Spring 1.2 for interoperability. */
private static final long serialVersionUID = -4688694393146734764L;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -24,7 +24,7 @@ import org.springframework.lang.Nullable;
/**
* The default implementation of Spring's {@link SqlRowSetMetaData} interface, wrapping
* a {@link java.sql.ResultSetMetaData} instance, catching any {@link SQLException}s
* a {@link java.sql.ResultSetMetaData} instance, catching any {@link SQLException java.sql.ResultSetMetaData} instance, catching any {@link SQLExceptions}
* and translating them to a corresponding Spring {@link InvalidResultSetAccessException}.
*
* <p>Used by {@link ResultSetWrappingSqlRowSet}.

View File

@@ -219,8 +219,8 @@ public interface SqlRowSet extends Serializable {
* (for NCHAR, NVARCHAR, LONGNVARCHAR columns).
* @param columnIndex the column index
* @return a String representing the column value
* @see java.sql.ResultSet#getNString(int)
* @since 4.1.3
* @see java.sql.ResultSet#getNString(int)
*/
String getNString(int columnIndex) throws InvalidResultSetAccessException;
@@ -229,8 +229,8 @@ public interface SqlRowSet extends Serializable {
* (for NCHAR, NVARCHAR, LONGNVARCHAR columns).
* @param columnLabel the column label
* @return a String representing the column value
* @see java.sql.ResultSet#getNString(String)
* @since 4.1.3
* @see java.sql.ResultSet#getNString(String)
*/
String getNString(String columnLabel) throws InvalidResultSetAccessException;