@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
/ *
* Copyright 2002 - 2017 the original author or authors .
* Copyright 2002 - 2020 the original author or authors .
*
* Licensed under the Apache License , Version 2 . 0 ( the "License" ) ;
* you may not use this file except in compliance with the License .
@ -61,7 +61,7 @@ public interface NamedParameterJdbcOperations {
@@ -61,7 +61,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 }
@ -78,7 +78,7 @@ public interface NamedParameterJdbcOperations {
@@ -78,7 +78,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
@ -96,7 +96,7 @@ public interface NamedParameterJdbcOperations {
@@ -96,7 +96,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
@ -107,7 +107,7 @@ public interface NamedParameterJdbcOperations {
@@ -107,7 +107,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
@ -120,12 +120,12 @@ public interface NamedParameterJdbcOperations {
@@ -120,12 +120,12 @@ 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
* @return an arbitrary result object , as returned by the ResultSetExtractor
* @throws org . springframework . dao . DataAccessException if the query fails
* @throws DataAccessException if the query fails
* /
< T > T query ( String sql , Map < String , ? > paramMap , ResultSetExtractor < T > rse )
throws DataAccessException ;
@ -136,10 +136,10 @@ public interface NamedParameterJdbcOperations {
@@ -136,10 +136,10 @@ 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
* @throws DataAccessException if the query fails
* /
< T > T query ( String sql , ResultSetExtractor < T > rse ) throws DataAccessException ;
@ -147,7 +147,7 @@ public interface NamedParameterJdbcOperations {
@@ -147,7 +147,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
@ -159,11 +159,11 @@ public interface NamedParameterJdbcOperations {
@@ -159,11 +159,11 @@ 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
* @throws org . springframework . dao . DataAccessException if the query fails
* @throws DataAccessException if the query fails
* /
void query ( String sql , Map < String , ? > paramMap , RowCallbackHandler rch ) throws DataAccessException ;
@ -173,9 +173,9 @@ public interface NamedParameterJdbcOperations {
@@ -173,9 +173,9 @@ 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
* @throws DataAccessException if the query fails
* /
void query ( String sql , RowCallbackHandler rch ) throws DataAccessException ;
@ -183,11 +183,11 @@ public interface NamedParameterJdbcOperations {
@@ -183,11 +183,11 @@ 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
* @throws org . springframework . dao . DataAccessException if the query fails
* @throws DataAccessException if the query fails
* /
< T > List < T > query ( String sql , SqlParameterSource paramSource , RowMapper < T > rowMapper )
throws DataAccessException ;
@ -196,12 +196,12 @@ public interface NamedParameterJdbcOperations {
@@ -196,12 +196,12 @@ 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
* @return the result List , containing mapped objects
* @throws org . springframework . dao . DataAccessException if the query fails
* @throws DataAccessException if the query fails
* /
< T > List < T > query ( String sql , Map < String , ? > paramMap , RowMapper < T > rowMapper )
throws DataAccessException ;
@ -212,10 +212,10 @@ public interface NamedParameterJdbcOperations {
@@ -212,10 +212,10 @@ 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
* @throws DataAccessException if the query fails
* /
< T > List < T > query ( String sql , RowMapper < T > rowMapper ) throws DataAccessException ;
@ -223,7 +223,7 @@ public interface NamedParameterJdbcOperations {
@@ -223,7 +223,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
@ -231,7 +231,7 @@ public interface NamedParameterJdbcOperations {
@@ -231,7 +231,7 @@ public interface NamedParameterJdbcOperations {
* @throws org . springframework . dao . IncorrectResultSizeDataAccessException
* if the query does not return exactly one row , or does not return exactly
* one column in that row
* @throws org . springframework . dao . DataAccessException if the query fails
* @throws DataAccessException if the query fails
* /
< T > T queryForObject ( String sql , SqlParameterSource paramSource , RowMapper < T > rowMapper )
throws DataAccessException ;
@ -240,7 +240,7 @@ public interface NamedParameterJdbcOperations {
@@ -240,7 +240,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
@ -249,7 +249,7 @@ public interface NamedParameterJdbcOperations {
@@ -249,7 +249,7 @@ public interface NamedParameterJdbcOperations {
* @throws org . springframework . dao . IncorrectResultSizeDataAccessException
* if the query does not return exactly one row , or does not return exactly
* one column in that row
* @throws org . springframework . dao . DataAccessException if the query fails
* @throws DataAccessException if the query fails
* /
< T > T queryForObject ( String sql , Map < String , ? > paramMap , RowMapper < T > rowMapper )
throws DataAccessException ;
@ -259,14 +259,14 @@ public interface NamedParameterJdbcOperations {
@@ -259,14 +259,14 @@ 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
* @throws org . springframework . dao . IncorrectResultSizeDataAccessException
* if the query does not return exactly one row , or does not return exactly
* one column in that row
* @throws org . springframework . dao . DataAccessException if the query fails
* @throws DataAccessException if the query fails
* @see org . springframework . jdbc . core . JdbcTemplate # queryForObject ( String , Class )
* /
< T > T queryForObject ( String sql , SqlParameterSource paramSource , Class < T > requiredType )
@ -277,7 +277,7 @@ public interface NamedParameterJdbcOperations {
@@ -277,7 +277,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
@ -285,7 +285,7 @@ public interface NamedParameterJdbcOperations {
@@ -285,7 +285,7 @@ public interface NamedParameterJdbcOperations {
* @throws org . springframework . dao . IncorrectResultSizeDataAccessException
* if the query does not return exactly one row , or does not return exactly
* one column in that row
* @throws org . springframework . dao . DataAccessException if the query fails
* @throws DataAccessException if the query fails
* @see org . springframework . jdbc . core . JdbcTemplate # queryForObject ( String , Class )
* /
< T > T queryForObject ( String sql , Map < String , ? > paramMap , Class < T > requiredType )
@ -296,12 +296,12 @@ public interface NamedParameterJdbcOperations {
@@ -296,12 +296,12 @@ 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
* if the query does not return exactly one row
* @throws org . springframework . dao . DataAccessException if the query fails
* @throws DataAccessException if the query fails
* @see org . springframework . jdbc . core . JdbcTemplate # queryForMap ( String )
* @see org . springframework . jdbc . core . ColumnMapRowMapper
* /
@ -315,13 +315,13 @@ public interface NamedParameterJdbcOperations {
@@ -315,13 +315,13 @@ 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 )
* @throws org . springframework . dao . IncorrectResultSizeDataAccessException
* if the query does not return exactly one row
* @throws org . springframework . dao . DataAccessException if the query fails
* @throws DataAccessException if the query fails
* @see org . springframework . jdbc . core . JdbcTemplate # queryForMap ( String )
* @see org . springframework . jdbc . core . ColumnMapRowMapper
* /
@ -332,12 +332,12 @@ public interface NamedParameterJdbcOperations {
@@ -332,12 +332,12 @@ 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 } )
* @return a List of objects that match the specified element type
* @throws org . springframework . dao . DataAccessException if the query fails
* @throws DataAccessException if the query fails
* @see org . springframework . jdbc . core . JdbcTemplate # queryForList ( String , Class )
* @see org . springframework . jdbc . core . SingleColumnRowMapper
* /
@ -349,13 +349,13 @@ public interface NamedParameterJdbcOperations {
@@ -349,13 +349,13 @@ 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
* ( for example , { @code Integer . class } )
* @return a List of objects that match the specified element type
* @throws org . springframework . dao . DataAccessException if the query fails
* @throws DataAccessException if the query fails
* @see org . springframework . jdbc . core . JdbcTemplate # queryForList ( String , Class )
* @see org . springframework . jdbc . core . SingleColumnRowMapper
* /
@ -369,10 +369,10 @@ public interface NamedParameterJdbcOperations {
@@ -369,10 +369,10 @@ 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
* @throws DataAccessException if the query fails
* @see org . springframework . jdbc . core . JdbcTemplate # queryForList ( String )
* /
List < Map < String , Object > > queryForList ( String sql , SqlParameterSource paramSource ) throws DataAccessException ;
@ -384,11 +384,11 @@ public interface NamedParameterJdbcOperations {
@@ -384,11 +384,11 @@ 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
* @throws org . springframework . dao . DataAccessException if the query fails
* @throws DataAccessException if the query fails
* @see org . springframework . jdbc . core . JdbcTemplate # queryForList ( String )
* /
List < Map < String , Object > > queryForList ( String sql , Map < String , ? > paramMap ) throws DataAccessException ;
@ -402,11 +402,11 @@ public interface NamedParameterJdbcOperations {
@@ -402,11 +402,11 @@ 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 } )
* @throws org . springframework . dao . DataAccessException if there is any problem executing the query
* @throws DataAccessException if there is any problem executing the query
* @see org . springframework . jdbc . core . JdbcTemplate # queryForRowSet ( String )
* @see org . springframework . jdbc . core . SqlRowSetResultSetExtractor
* @see javax . sql . rowset . CachedRowSet
@ -422,12 +422,12 @@ public interface NamedParameterJdbcOperations {
@@ -422,12 +422,12 @@ 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
* { @code javax . sql . rowset . CachedRowSet } )
* @throws org . springframework . dao . DataAccessException if there is any problem executing the query
* @throws DataAccessException if there is any problem executing the query
* @see org . springframework . jdbc . core . JdbcTemplate # queryForRowSet ( String )
* @see org . springframework . jdbc . core . SqlRowSetResultSetExtractor
* @see javax . sql . rowset . CachedRowSet
@ -436,31 +436,31 @@ public interface NamedParameterJdbcOperations {
@@ -436,31 +436,31 @@ 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
* @throws DataAccessException if there is any problem issuing the update
* /
int update ( String sql , SqlParameterSource paramSource ) throws DataAccessException ;
/ * *
* 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
* @throws org . springframework . dao . DataAccessException if there is any problem issuing the update
* @throws DataAccessException if there is any problem issuing the update
* /
int update ( String sql , Map < String , ? > paramMap ) throws DataAccessException ;
/ * *
* 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
* @throws DataAccessException if there is any problem issuing the update
* @see MapSqlParameterSource
* @see org . springframework . jdbc . support . GeneratedKeyHolder
* /
@ -470,12 +470,12 @@ public interface NamedParameterJdbcOperations {
@@ -470,12 +470,12 @@ 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
* @throws DataAccessException if there is any problem issuing the update
* @see MapSqlParameterSource
* @see org . springframework . jdbc . support . GeneratedKeyHolder
* /
@ -487,6 +487,7 @@ public interface NamedParameterJdbcOperations {
@@ -487,6 +487,7 @@ public interface NamedParameterJdbcOperations {
* @param sql the SQL statement to execute
* @param batchValues the array of Maps containing the batch of arguments for the query
* @return an array containing the numbers of rows affected by each update in the batch
* @throws DataAccessException if there is any problem issuing the update
* /
int [ ] batchUpdate ( String sql , Map < String , ? > [ ] batchValues ) ;
@ -495,6 +496,7 @@ public interface NamedParameterJdbcOperations {
@@ -495,6 +496,7 @@ public interface NamedParameterJdbcOperations {
* @param sql the SQL statement to execute
* @param batchArgs the array of { @link SqlParameterSource } containing the batch of arguments for the query
* @return an array containing the numbers of rows affected by each update in the batch
* @throws DataAccessException if there is any problem issuing the update
* /
int [ ] batchUpdate ( String sql , SqlParameterSource [ ] batchArgs ) ;