spring-boot使用CodeGenerator自动创建mybatis
•文章
56 0
项目结构为这样
修改包配置
运行此文件
按要求输入配置
回车后就发现以及创建好了代码了
修改扫描文件
这里可以添加增删改查接口
调用增加接口:
如果报错显示,就是没添加scan
报错显示:
Error creating bean with name ‘userServiceImpl’: Unsatisfied dependency expressed through field ‘baseMapper’; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘com.nanfangzhe.anpaipublic.mapper.UserMapper’ available: expected at least 1 bean which qualifies as autowire candidate.
@MapperScan(“com.atguigu.mybatis_plus.mapper”)
版权属于:戏人看戏博客网
本文链接:https://day.nb.sb/archives/531.html
若无注明均为戏人看戏原创,转载请注明出处,感谢您的支持!