Home > Back-end >  Springboot integration mybaits error Could not autowire. No beans of 'StudentMapper type foun
Springboot integration mybaits error Could not autowire. No beans of 'StudentMapper type foun

Time:11-30

If inscribe
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 mapper

CodePudding user response:

Scanning annotation was no problem, this is the idea of examination questions, ran up and does not affect the program

CodePudding user response:

3 l positive solution, feel the growths can add @ Repository annotations on mapper interfaces, without also does not affect the operation
  • Related