If there is multiple implementation of an interface then we need to specify which one's implementation will use. For that reason we need to specify @Primary in the implemented class or we can use autowired by name .But @Primary annotation have the highest precedence than autowired by name.
Another approach is we can use @Qualifier("name") over the name of the implement class .We then should use this @Qualifier("name") over the injected interface.
No comments:
Post a Comment