@@ -20,11 +20,8 @@ public class CustomerDataService {
2020 * @param customer the customer
2121 * @return the address
2222 */
23-
2423 @ Cacheable ("addresses" , “directory ”)
25-
2624 public String getAddress1 (Customer customer ) {
27-
2825 return customer .getAddress ();
2926 }
3027
@@ -35,11 +32,8 @@ public String getAddress1(Customer customer) {
3532 * @param customer the customer
3633 * @return the address
3734 */
38-
3935 @ CacheEvict (value ="addresses" , allEntries =true )
40-
4136 public String getAddress2 (Customer customer ) {
42-
4337 return customer .getAddress ();
4438 }
4539
@@ -50,11 +44,8 @@ public String getAddress2(Customer customer) {
5044 * @param customer the customer
5145 * @return the address
5246 */
53-
5447 @ Caching (evict = { @ CacheEvict ("addresses" ), @ CacheEvict (value ="directory" , key ="customer.name" ) })
55-
5648 public String getAddress3 (Customer customer ) {
57-
5849 return customer .getAddress ();
5950 }
6051
@@ -64,11 +55,8 @@ public String getAddress3(Customer customer) {
6455 * @param customer the customer
6556 * @return the address
6657 */
67-
6858 @ Cacheable // parameter not required as we have declared it using @CacheConfig
69-
7059 public String getAddress4 (Customer customer ) {
71-
7260 return customer .getAddress ();
7361 }
7462
@@ -78,13 +66,9 @@ public String getAddress4(Customer customer) {
7866 * @param customer the customer
7967 * @return the address
8068 */
81-
82-
8369 @ CachePut (value ="addresses" , condition =”#customer .name =’Tom ’”)
8470 @ CachePut (value ="addresses" , unless =”#result .length >64 ”)
85-
8671 public String getAddress5 (Customer customer ) {
87-
8872 return customer .getAddress ();
8973 }
9074
0 commit comments