課程
/后端開發(fā)
/Java
/SpringBoot開發(fā)常用技術整合
private SysUserMapper userMapper 這個沒法用
2018-11-22
源自:SpringBoot開發(fā)常用技術整合 8-2
正在回答
在SysUserMApper接口上面添加一個
@Repository
就行了
該注解時從spring2.0開始增加的注解,用于簡化spring的開發(fā),將數(shù)據(jù)訪問層的類標識為SpringBean。
@MapperScan注解要使用這個import tk.mybatis.spring.annotation.MapperScan,不要使用import org.mybatis.spring.annotation.MapperScan;
1.這樣用:
@Autowired
private SysUserMapper sysUserMapper;
2.Mapper接口用@Mapper注解了嗎?
舉報
SpringBoot 極簡開發(fā)的框架整合利器
3 回答生成的SysUserMapper有錯
2 回答為什么說SysUserMapper在自動裝配的時候提示沒有實現(xiàn)類
2 回答queryUserListPaged 這個方法中的SysUser user參數(shù) 有什么用 搞不懂
1 回答mybatis逆向工程無法找到這個類啊
2 回答這個報錯,數(shù)據(jù)庫沒連上?用戶名密碼還有URL都是對的
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學習伙伴
掃描二維碼關注慕課網(wǎng)微信公眾號
2019-05-20
在SysUserMApper接口上面添加一個
就行了
該注解時從spring2.0開始增加的注解,用于簡化spring的開發(fā),將數(shù)據(jù)訪問層的類標識為SpringBean。
2018-12-27
@MapperScan注解要使用這個import tk.mybatis.spring.annotation.MapperScan,不要使用import org.mybatis.spring.annotation.MapperScan;
2018-11-22
1.這樣用:
@Autowired
private SysUserMapper sysUserMapper;
2.Mapper接口用@Mapper注解了嗎?