(spring mvc)first i do not know whether the writing below are right or not.if it is right ,then i don't understand how the @autowired works here.if it is wrong , then how i should do when i have more than one classes to implement one interface.
public interface UserDao{
public User findUserByUserName(String username);
}
public class UserDaoImpl1 implements UserDao{
@Override
public User findUserByUserName(String username){
.......
}
}
public class UserDaoImpl2 implements UserDao{
@Override
public User findUserByUserName(String username){
.......
}
}
@Service
public class UserServiceImpl implements UserService{
@Autowired
private UserDao userDao;//how does atuowired work here?
@Override
public User loginCheck(User user){
......
}
}