diff --git a/spring-context/src/main/java/org/springframework/cache/annotation/CacheConfig.java b/spring-context/src/main/java/org/springframework/cache/annotation/CacheConfig.java index 234f353b14..78da3a22e5 100644 --- a/spring-context/src/main/java/org/springframework/cache/annotation/CacheConfig.java +++ b/spring-context/src/main/java/org/springframework/cache/annotation/CacheConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2023 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 java.lang.annotation.Target; * @author Stephane Nicoll * @author Sam Brannen * @since 4.1 + * @see Cacheable */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) @@ -42,8 +43,10 @@ public @interface CacheConfig { * Names of the default caches to consider for caching operations defined * in the annotated class. *
If none is set at the operation level, these are used instead of the default. - *
May be used to determine the target cache (or caches), matching the - * qualifier value or the bean names of a specific bean definition. + *
Names may be used to determine the target cache(s), to be resolved via the + * configured {@link #cacheResolver()} which typically delegates to + * {@link org.springframework.cache.CacheManager#getCache}. + * For further details see {@link Cacheable#cacheNames()}. */ String[] cacheNames() default {}; diff --git a/spring-context/src/main/java/org/springframework/cache/annotation/Cacheable.java b/spring-context/src/main/java/org/springframework/cache/annotation/Cacheable.java index 13e097ca2a..d91249da5e 100644 --- a/spring-context/src/main/java/org/springframework/cache/annotation/Cacheable.java +++ b/spring-context/src/main/java/org/springframework/cache/annotation/Cacheable.java @@ -68,8 +68,12 @@ public @interface Cacheable { /** * Names of the caches in which method invocation results are stored. - *
Names may be used to determine the target cache (or caches), matching - * the qualifier value or bean name of a specific bean definition. + *
Names may be used to determine the target cache(s), to be resolved via the + * configured {@link #cacheResolver()} which typically delegates to + * {@link org.springframework.cache.CacheManager#getCache}. + *
This will usually be a single cache name. If multiple names are specified, + * they will be consulted for a cache hit in the order of definition, and they + * will all receive a put/evict request for the same newly cached value. * @since 4.2 * @see #value * @see CacheConfig#cacheNames diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/JdbcTemplate.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/JdbcTemplate.java index 335a96022a..cb05218656 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/JdbcTemplate.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/JdbcTemplate.java @@ -60,7 +60,7 @@ import org.springframework.util.LinkedCaseInsensitiveMap; import org.springframework.util.StringUtils; /** - * This is the central class in the JDBC core package. + * This is the central delegate in the JDBC core package. * It simplifies the use of JDBC and helps to avoid common errors. * It executes core JDBC workflow, leaving application code to provide SQL * and extract results. This class executes SQL queries or updates, initiating @@ -417,9 +417,7 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations { logger.debug("Executing SQL statement [" + sql + "]"); } - /** - * Callback to execute the statement. - */ + // Callback to execute the statement. class ExecuteStatementCallback implements StatementCallback