我这边为了让mapper类生效, 做了:
1.Application.java中使用@MapperScan(“com.example.mapper也就是你的mapper包所在的路径”)
2.在mapper接口上加上@Mapper注解,注意不要使用@Component和@Repository
3.保证实体类中:类名和表名相对应;实体类字段名要和数据库中的字段一一对应;无法对应的字段要加上@Transient注解
Spring Boot 安装通用mapper: Error creating bean with name *Mapper: Unsatisfied dependency......
最新推荐文章于 2024-06-12 15:07:15 发布