package cn.nyc.service;
import cn.nyc.po.Customer;
public interface CustomerService {
public Customer findCustomerById(Integer id);
}
package cn.nyc.service.impl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import cn.nyc.dao.CustomerDao;
import cn.nyc.po.Customer;
import cn.nyc.service.CustomerService;
@Service
@Transactional
public class CustomerServiceImpl implements CustomerService{
//注解注入CustomerDao
@Autowired
private CustomerDao customerDao;
//查询客户
public Customer findCustomerById(Integer id) {
return this.customerDao.findCustomerById(id);
}
}
当实现类没有写 implements CustomerService时, 是怎样一步一步跑下去的,和正常的有什么区别,为什么没有写会挂?