'com.example.mybatisplus.mapper.PersonMapper' that could not be found.
通常有两种原因,配置原因,或者是mapper相关文件,mapper.java或 mapper.xml内部错误

如果是配置原因
解决方式1
统一配置mapper
//import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication
@MapperScan("com.example.mybatisplus.mapper") //把这个加上,别写上正确的路径,如果是模块化一般路径为@MapperScan("com.kfit.*.mapper")
public class Application {
public static void main(String[] args){
System.out.println("hahahaha");
SpringApplication.run(Application.class, args);
}
}
解决方式2
每个mapper文件配置@Mapper
package com.example.mybatisplus.mapper; //import org.apache.ibatis.annotations.Mapper; import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.example.mybatisplus.entity.Person;
@Mapper //每个文件配置这个
public interface PersonMapper extends BaseMapper<Person> {
Integer listCount();
Person findPersonById(Integer id);
}
两者可以结合使用
'com.example.mybatisplus.mapper.PersonMapper' that could not be found.的更多相关文章
- MyBatis Plus:No qualifying bean of type 'com.baomidou.mybatisplus.mapper.BaseMapper<?>' available: expected single matching bean but found 4
场景: 应用MyBatis Plus 和通用Mapper 继承自ServiceImpl实现对Service里的方法进行包装再处理. public interface IServiceBase2< ...
- 2流高手速成记(之三):SpringBoot整合mybatis/mybatis-plus实现数据持久化
接上回 上一篇我们简单介绍了基于SpringBoot实现简单的Web开发,本节来看Web开发中必不可少的内容--数据持久化 先看项目结构: 1. 创建数据表 打开mysql,打开数据库 test (没 ...
- Mybatis-Plus多表联查
表格结构: CREATE TABLE `ssmpdemo`.`person_test` ( `id` varchar(32) CHARACTER SET utf8 COLLATE utf8_gener ...
- 03_MyBatis基本查询,mapper文件的定义,测试代码的编写,resultMap配置返回值,sql片段配置,select标签标签中的内容介绍,配置使用二级缓存,使用别名的数据类型,条件查询ma
1 PersonTestMapper.xml中的内容如下: <?xmlversion="1.0"encoding="UTF-8"?> < ...
- Mybatis-plus快速入门
简介 MyBatis-Plus(简称 MP)是一个 MyBatis 的增强工具,在 MyBatis 的基础上只做增强不做改变,为简化开发.提高效率而生. 特性 无侵入:只做增强不做改变,引入它不会对现 ...
- Mybatis-Plus入门
1 Mybatis-Plus简介 1.1 什么是Mybatis-Plus MyBatis-Plus(简称 MP)是一个 MyBatis 的增强工具,在 MyBatis 的基础上只做增强不做改变,为简化 ...
- mybatis mapper映射文件全解
目录 select.update.delete.insert 设置参数类型以及取值 基本数据类型 对象数据类型 map数据类型 #{ } 和 ${ } 的区别 ResultMap Auto-map ...
- MyBatis-Plus初步使用
在使用mybatis的过程中,我们会发现需要自己写很多的mapper和mapper.xml配置文件,很多时候会写到相当多的重复代码,特别是普通的增删改查,这样不仅会影响我们的开发效率,也会使得代码变的 ...
- MyBatis-Plus的简单使用
mybatis-plus也只是听过,可是终究没有使用过.于是自己花几天晚上的时间研究mybatis-plus的使用. 下面的研究也是基于其官网:http://mp.baomidou.com/guide ...
随机推荐
- 解决 windows oracle ORA-01113和ORA-01110错误
windows2008上的数据库版本为11.2.0.4.0,数据库打开为mount状态.报错如下: SQL> startup ORACLE instance started. Total Sys ...
- 数据结构——java实现栈
栈 定义: 栈是一种先进后出的数据结构,我们把允许插入和删除的一端称为栈顶,另一端称为栈底,不含任何元素的栈称为空栈 栈的java代码实现: 基于数组: import org.junit.jupite ...
- rgba()和opacity的比较(转)
https://blog.csdn.net/u014150409/article/details/44906767
- 如何将 HTML 转换为 XHTML
1.添加一个 XHTML <!DOCTYPE> 到你的网页中 2.添加 xmlns 属性添加到每个页面的html元素中 3.改变所有的元素为小写 4.关闭所有的空元素 5.修改所有的属性名 ...
- liteide
/liteide$ bin/liteide Cannot mix incompatible Qt library (version 0x40806) with this library (versio ...
- [JZOJ5888]GCD生成树
[JZOJ5888]GCD生成树 题目链接 gugugu 分析 对于N很小的情况,暴力Prim即可 对于值域很小的情况,我的想法与solution不太一样,将值相同的缩成一个点,\(O(w^2)\)预 ...
- python打印表格式数据-星号或注释
python打印表格式数据,留出正确的空格,格式化打出 代码如下: def printPicnic(itemsDict,leftWidth,rightWidth): print('PICNIC ITE ...
- Python TCP通信之仿文件下载
TCP_文件下载_Client.py import socket def main(): # 创建TCP套接字 tcp_socket = socket.socket(socket.AF_INET, s ...
- 从graphql endpoint获取schema文件
graphql server端有更新,client端需要重新获取schema文件用于创建新的api request,下面简要记录如何从graphql endpoint获取schema文件 You ca ...
- stm32 i2c eeprom 24C02
电路图 相关文章:http://blog.csdn.net/zhangxuechao_/article/details/74936798 举例 #define i2c_scl PBout(10) #d ...