AnnotationTransactionAttributeSource applies class-level metadata to user-level methods only

Issue: SPR-14095
This commit is contained in:
Juergen Hoeller
2016-03-30 10:21:22 +02:00
parent ea09e578b9
commit b7819e6ec8
3 changed files with 90 additions and 13 deletions

View File

@@ -155,7 +155,7 @@ public abstract class AbstractFallbackTransactionAttributeSource implements Tran
// Second try is the transaction attribute on the target class.
txAtt = findTransactionAttribute(specificMethod.getDeclaringClass());
if (txAtt != null) {
if (txAtt != null && ClassUtils.isUserLevelMethod(method)) {
return txAtt;
}
@@ -166,8 +166,12 @@ public abstract class AbstractFallbackTransactionAttributeSource implements Tran
return txAtt;
}
// Last fallback is the class of the original method.
return findTransactionAttribute(method.getDeclaringClass());
txAtt = findTransactionAttribute(method.getDeclaringClass());
if (txAtt != null && ClassUtils.isUserLevelMethod(method)) {
return txAtt;
}
}
return null;
}