Skip to content

Introduce @EnableSpringConfigured [SPR-7888] #12544

Closed
@spring-projects-issues

Description

@spring-projects-issues

Chris Beams opened SPR-7888 and commented

Equivalent to context:spring-configured/

Because @Configuration classes don't produce bean definitions in quite the same way that XML configuration files do, an annotation-based @SpringConfigured annotation must work differently than context:spring-configured/. Consider the following approach:

@Configurationpublic class SpringConfiguredBeans {

@SpringConfigured
public void someEntity(MyEntity entity) {
    entity.setRepository(myRepository());        
}

@Bean
public MyRepository myRepository() {
    return new MyRepository(dataSource());
}

// ...}

Issue Links:

Referenced from: commits 22e37aa, d356205, 4318ccd

1 votes, 2 watchers

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions