The new engineering
Start the class:
@ MapperScan (value="https://bbs.csdn.net/topics/com.bandian.mapper")
@ Service to inject an error
The @autowired
Private StudentMapper StudentMapper;
Package com. Bandian. Mapper;
The import com. Bandian. Entity. The Student;
The import org. Springframework. Stereotype. The Repository;
Public interface StudentMapper {
Int deleteByPrimaryKey (Integer id);
Int the insert (Student record);
Int insertSelective (Student record);
Student selectByPrimaryKey (Integer id);
Int updateByPrimaryKeySelective (Student record);
Int updateByPrimaryKey (Student record);
}
CodePudding user response:
CodePudding user response:
Add the @ mapper and @ Component mapperCodePudding user response:
Scanning annotation was no problem, this is the idea of examination questions, ran up and does not affect the programCodePudding user response:
3 l positive solution, feel the growths can add @ Repository annotations on mapper interfaces, without also does not affect the operation