Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@EnableTransactionManagement and co should also get detected on superclasses [SPR-10864] #15491

Closed
spring-projects-issues opened this issue Aug 27, 2013 · 1 comment
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Aug 27, 2013

Neale Upstone opened SPR-10864 and commented

Annotating a super-class with @EnableTransactionManagement results in the following exception message: @EnableTransactionManagement is not present on importing class ConcreteClass

This is a complete gotcha when someone will get from trying to be DRY.

It seems that the only way to cause this is to import a class that extends one with the annotation.

If this is the case, then I suggest that the exception should point to the Javadoc of @EnableTransactionManagement, and that the Javadoc should explain why it is not @Inherited.


Issue Links:

Referenced from: commits ce917d5, e8dead2

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

After a bit of research, I'm redefining this issue to actually support the detection of @EnableTransactionManagement and co on superclasses. There doesn't seem to be a conceptual reason not to do so, and with a bit of internal refactoring, it works smoothly.

So as of Spring 4.0, we officially support @Enable* annotations on @Configuration superclasses. Note that @Enable* annotations still aren't marked as @Inherited; we process them on the actual superclass, which means participating in the detection of reoccuring superclasses etc, just like we do for regular @Configuration processing.

Juergen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants