I am studying Spring framework and I have the following doubt related the @Autowired annotation on the constructor of this example:
@Component
public class TransferServiceImpl implements TransferService {
@Autowired
public TransferServiceImpl(AccountRepository repo) {
this.accountRepository = repo;
}
}
So what exactly mean? That the AccountRepository repo object (definied as a component somewhere) is automatically injected into the TransferServiceImpl() constructor?
How it work this operation? Is it done by type? (because AccountRepository is a singleton for Spring default), or what?
Tnx