如題
新建的工程
啟動類:
@MapperScan(value = "com.bandian.mapper")
@Service 中注入報錯
@Autowired
private StudentMapper studentMapper;
package com.bandian.mapper;
import com.bandian.entity.Student;
import org.springframework.stereotype.Repository;
public interface StudentMapper {
int deleteByPrimaryKey(Integer id);
int insert(Student record);
int insertSelective(Student record);
Student selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(Student record);
int updateByPrimaryKey(Student record);
}
uj5u.com熱心網友回復:
uj5u.com熱心網友回復:
mapper上增加@Mapper和@Componentuj5u.com熱心網友回復:
加了掃描注解就沒問題了,這是idea的檢查問題,程式跑起來不影響uj5u.com熱心網友回復:
3l正解,覺得礙眼的可以在mapper介面上加@Repository注解,不加也不影響運行轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/19291.html
標籤:Web 開發
上一篇:用IDEA新建一個springboot+mybatis專案
下一篇:百度地圖云麻點無法顯示
