diff --git a/spring-context/src/main/java/org/springframework/cache/interceptor/CompositeCacheOperationSource.java b/spring-context/src/main/java/org/springframework/cache/interceptor/CompositeCacheOperationSource.java index da9533717a..9e1387a9ca 100644 --- a/spring-context/src/main/java/org/springframework/cache/interceptor/CompositeCacheOperationSource.java +++ b/spring-context/src/main/java/org/springframework/cache/interceptor/CompositeCacheOperationSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 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,6 +66,16 @@ public class CompositeCacheOperationSource implements CacheOperationSource, Seri return false; } + @Override + public boolean hasCacheOperations(Method method, @Nullable Class targetClass) { + for (CacheOperationSource source : this.cacheOperationSources) { + if (source.hasCacheOperations(method, targetClass)) { + return true; + } + } + return false; + } + @Override @Nullable public Collection getCacheOperations(Method method, @Nullable Class targetClass) { diff --git a/spring-tx/src/main/java/org/springframework/transaction/interceptor/CompositeTransactionAttributeSource.java b/spring-tx/src/main/java/org/springframework/transaction/interceptor/CompositeTransactionAttributeSource.java index 8b735f0d4d..d547829066 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/interceptor/CompositeTransactionAttributeSource.java +++ b/spring-tx/src/main/java/org/springframework/transaction/interceptor/CompositeTransactionAttributeSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 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. @@ -63,6 +63,16 @@ public class CompositeTransactionAttributeSource implements TransactionAttribute return false; } + @Override + public boolean hasTransactionAttribute(Method method, @Nullable Class targetClass) { + for (TransactionAttributeSource source : this.transactionAttributeSources) { + if (source.hasTransactionAttribute(method, targetClass)) { + return true; + } + } + return false; + } + @Override @Nullable public TransactionAttribute getTransactionAttribute(Method method, @Nullable Class targetClass) {