Polishing
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -35,6 +35,7 @@ import org.springframework.util.Assert;
|
||||
* @author Juergen Hoeller
|
||||
* @author Stephane Nicoll
|
||||
* @since 4.3
|
||||
* @see CaffeineCacheManager
|
||||
*/
|
||||
public class CaffeineCache extends AbstractValueAdaptingCache {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -34,6 +34,7 @@ import org.springframework.util.Assert;
|
||||
* @author Juergen Hoeller
|
||||
* @author Stephane Nicoll
|
||||
* @since 3.1
|
||||
* @see EhCacheCacheManager
|
||||
*/
|
||||
public class EhCacheCache implements Cache {
|
||||
|
||||
@@ -95,7 +96,6 @@ public class EhCacheCache implements Cache {
|
||||
this.cache.releaseWriteLockOnKey(key);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private <T> T loadValue(Object key, Callable<T> valueLoader) {
|
||||
|
||||
@@ -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.
|
||||
@@ -34,6 +34,7 @@ import org.springframework.util.Assert;
|
||||
* @author Juergen Hoeller
|
||||
* @author Stephane Nicoll
|
||||
* @since 3.1
|
||||
* @see EhCacheCache
|
||||
*/
|
||||
public class EhCacheCacheManager extends AbstractTransactionSupportingCacheManager {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -36,6 +36,7 @@ import org.springframework.util.Assert;
|
||||
* @author Juergen Hoeller
|
||||
* @author Stephane Nicoll
|
||||
* @since 3.2
|
||||
* @see JCacheCacheManager
|
||||
*/
|
||||
public class JCacheCache extends AbstractValueAdaptingCache {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -36,6 +36,7 @@ import org.springframework.util.Assert;
|
||||
* @author Juergen Hoeller
|
||||
* @author Stephane Nicoll
|
||||
* @since 3.2
|
||||
* @see JCacheCache
|
||||
*/
|
||||
public class JCacheCacheManager extends AbstractTransactionSupportingCacheManager {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -191,7 +191,7 @@ public class ConcurrentMapCache extends AbstractValueAdaptingCache {
|
||||
}
|
||||
|
||||
private Object serializeValue(SerializationDelegate serialization, Object storeValue) throws IOException {
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream(1024);
|
||||
try {
|
||||
serialization.serialize(storeValue, out);
|
||||
return out.toByteArray();
|
||||
|
||||
@@ -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.
|
||||
@@ -190,9 +190,7 @@ public class ConcurrentMapCacheManager implements CacheManager, BeanClassLoaderA
|
||||
*/
|
||||
protected Cache createConcurrentMapCache(String name) {
|
||||
SerializationDelegate actualSerialization = (isStoreByValue() ? this.serialization : null);
|
||||
return new ConcurrentMapCache(name, new ConcurrentHashMap<>(256),
|
||||
isAllowNullValues(), actualSerialization);
|
||||
|
||||
return new ConcurrentMapCache(name, new ConcurrentHashMap<>(256), isAllowNullValues(), actualSerialization);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -30,6 +30,7 @@ import org.springframework.util.Assert;
|
||||
* @author Costin Leau
|
||||
* @author Stephane Nicoll
|
||||
* @since 4.3.4
|
||||
* @see NoOpCacheManager
|
||||
*/
|
||||
public class NoOpCache implements Cache {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -37,7 +37,7 @@ import org.springframework.lang.Nullable;
|
||||
* @author Costin Leau
|
||||
* @author Stephane Nicoll
|
||||
* @since 3.1
|
||||
* @see CompositeCacheManager
|
||||
* @see NoOpCache
|
||||
*/
|
||||
public class NoOpCacheManager implements CacheManager {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -397,7 +397,6 @@ public class CacheReproTests {
|
||||
public TestBean insertItem(TestBean item) {
|
||||
return item;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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.
|
||||
@@ -35,8 +35,7 @@ import static org.junit.Assert.*;
|
||||
* @author Juergen Hoeller
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
public class ConcurrentMapCacheTests
|
||||
extends AbstractValueAdaptingCacheTests<ConcurrentMapCache> {
|
||||
public class ConcurrentMapCacheTests extends AbstractValueAdaptingCacheTests<ConcurrentMapCache> {
|
||||
|
||||
protected ConcurrentMap<Object, Object> nativeCache;
|
||||
|
||||
@@ -48,12 +47,11 @@ public class ConcurrentMapCacheTests
|
||||
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
public void setup() {
|
||||
this.nativeCache = new ConcurrentHashMap<>();
|
||||
this.cache = new ConcurrentMapCache(CACHE_NAME, this.nativeCache, true);
|
||||
this.nativeCacheNoNull = new ConcurrentHashMap<>();
|
||||
this.cacheNoNull = new ConcurrentMapCache(CACHE_NAME_NO_NULL,
|
||||
this.nativeCacheNoNull, false);
|
||||
this.cacheNoNull = new ConcurrentMapCache(CACHE_NAME_NO_NULL, this.nativeCacheNoNull, false);
|
||||
this.cache.clear();
|
||||
}
|
||||
|
||||
@@ -72,6 +70,7 @@ public class ConcurrentMapCacheTests
|
||||
return this.nativeCache;
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testIsStoreByReferenceByDefault() {
|
||||
assertFalse(this.cache.isStoreByValue());
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -100,7 +100,7 @@ public interface JdbcOperations {
|
||||
* @param rse a callback 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
|
||||
* @see #query(String, Object[], ResultSetExtractor)
|
||||
* @see #query(String, ResultSetExtractor, Object...)
|
||||
*/
|
||||
@Nullable
|
||||
<T> T query(String sql, ResultSetExtractor<T> rse) throws DataAccessException;
|
||||
@@ -114,7 +114,7 @@ public interface JdbcOperations {
|
||||
* @param sql the SQL query to execute
|
||||
* @param rch a callback that will extract results, one row at a time
|
||||
* @throws DataAccessException if there is any problem executing the query
|
||||
* @see #query(String, Object[], RowCallbackHandler)
|
||||
* @see #query(String, RowCallbackHandler, Object...)
|
||||
*/
|
||||
void query(String sql, RowCallbackHandler rch) throws DataAccessException;
|
||||
|
||||
@@ -128,7 +128,7 @@ public interface JdbcOperations {
|
||||
* @param rowMapper a callback that will map one object per row
|
||||
* @return the result List, containing mapped objects
|
||||
* @throws DataAccessException if there is any problem executing the query
|
||||
* @see #query(String, Object[], RowMapper)
|
||||
* @see #query(String, RowMapper, Object...)
|
||||
*/
|
||||
<T> List<T> query(String sql, RowMapper<T> rowMapper) throws DataAccessException;
|
||||
|
||||
@@ -146,7 +146,7 @@ public interface JdbcOperations {
|
||||
* @throws IncorrectResultSizeDataAccessException if the query does not
|
||||
* return exactly one row
|
||||
* @throws DataAccessException if there is any problem executing the query
|
||||
* @see #queryForObject(String, Object[], RowMapper)
|
||||
* @see #queryForObject(String, RowMapper, Object...)
|
||||
*/
|
||||
@Nullable
|
||||
<T> T queryForObject(String sql, RowMapper<T> rowMapper) throws DataAccessException;
|
||||
@@ -166,7 +166,7 @@ public interface JdbcOperations {
|
||||
* @throws IncorrectResultSizeDataAccessException if the query does not return
|
||||
* exactly one row, or does not return exactly one column in that row
|
||||
* @throws DataAccessException if there is any problem executing the query
|
||||
* @see #queryForObject(String, Object[], Class)
|
||||
* @see #queryForObject(String, Class, Object...)
|
||||
*/
|
||||
@Nullable
|
||||
<T> T queryForObject(String sql, Class<T> requiredType) throws DataAccessException;
|
||||
@@ -184,7 +184,7 @@ public interface JdbcOperations {
|
||||
* @throws IncorrectResultSizeDataAccessException if the query does not
|
||||
* return exactly one row
|
||||
* @throws DataAccessException if there is any problem executing the query
|
||||
* @see #queryForMap(String, Object[])
|
||||
* @see #queryForMap(String, Object...)
|
||||
* @see ColumnMapRowMapper
|
||||
*/
|
||||
Map<String, Object> queryForMap(String sql) throws DataAccessException;
|
||||
@@ -201,7 +201,7 @@ public interface JdbcOperations {
|
||||
* (for example, {@code Integer.class})
|
||||
* @return a List of objects that match the specified element type
|
||||
* @throws DataAccessException if there is any problem executing the query
|
||||
* @see #queryForList(String, Object[], Class)
|
||||
* @see #queryForList(String, Class, Object...)
|
||||
* @see SingleColumnRowMapper
|
||||
*/
|
||||
<T> List<T> queryForList(String sql, Class<T> elementType) throws DataAccessException;
|
||||
@@ -218,7 +218,7 @@ public interface JdbcOperations {
|
||||
* @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[])
|
||||
* @see #queryForList(String, Object...)
|
||||
*/
|
||||
List<Map<String, Object>> queryForList(String sql) throws DataAccessException;
|
||||
|
||||
@@ -237,7 +237,7 @@ public interface JdbcOperations {
|
||||
* @return a SqlRowSet representation (possibly a wrapper around a
|
||||
* {@code javax.sql.rowset.CachedRowSet})
|
||||
* @throws DataAccessException if there is any problem executing the query
|
||||
* @see #queryForRowSet(String, Object[])
|
||||
* @see #queryForRowSet(String, Object...)
|
||||
* @see SqlRowSetResultSetExtractor
|
||||
* @see javax.sql.rowset.CachedRowSet
|
||||
*/
|
||||
@@ -323,7 +323,8 @@ public interface JdbcOperations {
|
||||
* @throws DataAccessException if there is any problem
|
||||
*/
|
||||
@Nullable
|
||||
<T> T query(String sql, @Nullable PreparedStatementSetter pss, ResultSetExtractor<T> rse) throws DataAccessException;
|
||||
<T> T query(String sql, @Nullable PreparedStatementSetter pss, ResultSetExtractor<T> rse)
|
||||
throws DataAccessException;
|
||||
|
||||
/**
|
||||
* Query given SQL to create a prepared statement from SQL and a list of arguments
|
||||
@@ -466,7 +467,8 @@ public interface JdbcOperations {
|
||||
* @return the result List, containing mapped objects
|
||||
* @throws DataAccessException if the query fails
|
||||
*/
|
||||
<T> List<T> query(String sql, @Nullable PreparedStatementSetter pss, RowMapper<T> rowMapper) throws DataAccessException;
|
||||
<T> List<T> query(String sql, @Nullable PreparedStatementSetter pss, RowMapper<T> rowMapper)
|
||||
throws DataAccessException;
|
||||
|
||||
/**
|
||||
* Query given SQL to create a prepared statement from SQL and a list of
|
||||
@@ -903,6 +905,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
|
||||
* @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, List<Object[]> batchArgs) throws DataAccessException;
|
||||
|
||||
@@ -913,6 +916,7 @@ public interface JdbcOperations {
|
||||
* @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
|
||||
* @throws DataAccessException if there is any problem issuing the update
|
||||
*/
|
||||
int[] batchUpdate(String sql, List<Object[]> batchArgs, int[] argTypes) throws DataAccessException;
|
||||
|
||||
@@ -926,6 +930,7 @@ public interface JdbcOperations {
|
||||
* @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
|
||||
* @throws DataAccessException if there is any problem issuing the update
|
||||
* @since 3.1
|
||||
*/
|
||||
<T> int[][] batchUpdate(String sql, Collection<T> batchArgs, int batchSize,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -130,7 +130,7 @@ public interface NamedParameterJdbcOperations {
|
||||
* (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
|
||||
*/
|
||||
@Nullable
|
||||
<T> T query(String sql, Map<String, ?> paramMap, ResultSetExtractor<T> rse)
|
||||
@@ -145,7 +145,7 @@ public interface NamedParameterJdbcOperations {
|
||||
* @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
|
||||
*/
|
||||
@Nullable
|
||||
<T> T query(String sql, ResultSetExtractor<T> rse) throws DataAccessException;
|
||||
@@ -170,7 +170,7 @@ public interface NamedParameterJdbcOperations {
|
||||
* @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;
|
||||
|
||||
@@ -182,7 +182,7 @@ public interface NamedParameterJdbcOperations {
|
||||
* equivalent to a query call with an empty parameter Map.
|
||||
* @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;
|
||||
|
||||
@@ -194,7 +194,7 @@ public interface NamedParameterJdbcOperations {
|
||||
* @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;
|
||||
@@ -208,7 +208,7 @@ public interface NamedParameterJdbcOperations {
|
||||
* (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;
|
||||
@@ -222,7 +222,7 @@ public interface NamedParameterJdbcOperations {
|
||||
* @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;
|
||||
|
||||
@@ -238,7 +238,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
|
||||
*/
|
||||
@Nullable
|
||||
<T> T queryForObject(String sql, SqlParameterSource paramSource, RowMapper<T> rowMapper)
|
||||
@@ -257,7 +257,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
|
||||
*/
|
||||
@Nullable
|
||||
<T> T queryForObject(String sql, Map<String, ?> paramMap, RowMapper<T> rowMapper)
|
||||
@@ -275,7 +275,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)
|
||||
*/
|
||||
@Nullable
|
||||
@@ -295,7 +295,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)
|
||||
*/
|
||||
@Nullable
|
||||
@@ -312,7 +312,7 @@ public interface NamedParameterJdbcOperations {
|
||||
* @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,7 +332,7 @@ public interface NamedParameterJdbcOperations {
|
||||
* @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
|
||||
*/
|
||||
@@ -348,7 +348,7 @@ public interface NamedParameterJdbcOperations {
|
||||
* @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
|
||||
*/
|
||||
@@ -366,7 +366,7 @@ public interface NamedParameterJdbcOperations {
|
||||
* @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
|
||||
*/
|
||||
@@ -383,7 +383,7 @@ public interface NamedParameterJdbcOperations {
|
||||
* @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;
|
||||
@@ -399,7 +399,7 @@ public interface NamedParameterJdbcOperations {
|
||||
* @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;
|
||||
@@ -417,7 +417,7 @@ public interface NamedParameterJdbcOperations {
|
||||
* @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
|
||||
@@ -438,7 +438,7 @@ public interface NamedParameterJdbcOperations {
|
||||
* (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
|
||||
@@ -450,7 +450,7 @@ public interface NamedParameterJdbcOperations {
|
||||
* @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;
|
||||
|
||||
@@ -460,7 +460,7 @@ public interface NamedParameterJdbcOperations {
|
||||
* @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;
|
||||
|
||||
@@ -471,7 +471,7 @@ public interface NamedParameterJdbcOperations {
|
||||
* @param paramSource container of arguments and SQL types to bind to the query
|
||||
* @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
|
||||
*/
|
||||
@@ -486,7 +486,7 @@ public interface NamedParameterJdbcOperations {
|
||||
* @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
|
||||
*/
|
||||
@@ -498,6 +498,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);
|
||||
|
||||
@@ -506,6 +507,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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user