diff --git a/spring-framework-reference/src/jdbc.xml b/spring-framework-reference/src/jdbc.xml index 9dae5cc1cf..8e3269cf3f 100644 --- a/spring-framework-reference/src/jdbc.xml +++ b/spring-framework-reference/src/jdbc.xml @@ -479,11 +479,14 @@ private static final class ActorMapper implements RowMapper<Actor> { An alternative to explicit configuration is to use component-scanning and annotation support for dependency injection. In - this case you annotate the setter method for the - DataSource with the - @Autowired annotation. - - public class JdbcCorporateEventDao implements CorporateEventDao { + this case you annotate the class with + @Repository (which makes it a candidate + for component-scanning) and annotate the + DataSource setter method with + @Autowired. + + @Repository +public class JdbcCorporateEventDao implements CorporateEventDao { private JdbcTemplate jdbcTemplate;