码迷,mamicode.com
首页 > 移动开发 > 详细

通用Mapper环境下,mapper接口无法注入问题

时间:2019-01-06 12:01:51      阅读:516      评论:0      收藏:0      [点我收藏+]

标签:not   entity   inter   use   expressed   mybatis   interface   问题   com   

写了一个mapper接口

package com.nyist.mapper;

import com.nyist.entity.User;
import tk.mybatis.mapper.common.Mapper;

public interface UserMapper extends Mapper<User> {

}

在Service中注入该接口--启动项目,报错一气呵成??

Unsatisfied dependency expressed through field ‘userMapper‘; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘com.nyist.mapper.UserMapper‘ available:Unsatisfied dependency expressed through field ‘userMapper‘; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘com.nyist.mapper.UserMapper‘ available:

查看springboot启动类,

import tk.mybatis.spring.annotation.MapperScan;
@MapperScan("com.nyist.mapper")
.............

ok

通用Mapper环境下,mapper接口无法注入问题

标签:not   entity   inter   use   expressed   mybatis   interface   问题   com   

原文地址:https://www.cnblogs.com/mzc1997/p/10227485.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!