在引入mybatisplus插件后,mapper文件中的方法会提示 @MapKey is required

@MapKey的作用是在返回一个Map的时候,Map的key将映射成注解中的值的字段,从而使map变相可以作为List使用.

举例:

public class UserMapper(){//使用list接收//[{id:1111,name:"foo"},{id:2222,name:"bar"}]public List<User> useList();//使用带有@Mapkey("id")的Map<Integer,User>接收//{1111:{id:1111,name:"foo"},2222:{id:2222,name:"bar"}}@Mapkey("id")public Map<Integer,User> useMap();}

该特性作为以某一字段大批量查找特别方便。

@MapKey作用以及@MapKey is required解决方案相关推荐

  1. Mybatis报错mapkey is required解决方案

    Mybatis报错mapkey is required解决方案 问题背景 解决方案 总结 Lyric: 几天都没有喝水也能活 问题背景 因为使用了mybatisX插件,导致检查报错mapkey is ...

  2. error Microsoft Visual C++ 14.0 is required 解决方案

    error Microsoft Visual C++ 14.0 is required 解决方案 参考文章: (1)error Microsoft Visual C++ 14.0 is require ...

  3. Spring Boot 2.3.0——以war方式打包失败[webxml attribute is required]解决方案

    问题描述 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-cli) ...

  4. asp.net在发送邮件时出现服务器响应为: You are not authorized to send mail, authentication is required 解决方案...

    今天在处理一个asp.net发送邮件的程序时,总是出现"服务器响应为: You are not authorized to send mail, authentication is requ ...

  5. Could not find an activated virtualenv (required)解决方案

    Could not find an activated virtualenv (required) 在执行pip install --upgrade pip时报错 网上解决方案如下: https:// ...

  6. HikariPool-1 - dataSource or dataSourceClassName or jdbcUrl is required.解决方案

    故障错误 最近在使用Spring Boot 2.x with H2 Database 以及JPA整合一个项目的时候出现了下面这一个故障: ERROR 21448 --- [ main] com.zax ...

  7. Adobe Flashplayer orHTML5 Browser with WebGL or CSS3D support required 解决方案

    (Adobe Flashplayer orHTML5 Browser with WebGL or CSS3D support required)的意思是:需要Adobe Flashplayer 或 h ...

  8. 虚拟主机安装wp提示Fatal error: require(): Failed opening required解决方案

    自己今天在虚拟主机上传了wordpress然后输入地址安装报错: Fatal error: require(): Failed opening required '__DIR__/wp-blog-he ...

  9. MyBatis中@MapKey使用详解

    MyBatis中@MapKey使用详解 我们在上一篇文章中讲到在Select返回类型中是返回Map时,是对方法中是否存在注解@MapKey,这个注解我也是第一次看到,当时我也以为是纯粹的返回单个数据对 ...

最新文章

  1. 蓝桥杯国赛-矩阵计数三种解法-java实现
  2. python基础语法总结-Python基础语法精心总结!看完都知道的可以往下继续学习了...
  3. DOS环境下支持的最大内存是多少?
  4. 08-CSS基础-体验CSS
  5. ElementUI中el-table添加小计行之后调整在滚动条上方
  6. android onpreviewframe保存mp4_无需第三方工具!教你如何保存抖音完整版视频
  7. php curl 要安装pear,MacOS 安装pear
  8. How Many Pieces of Land ? (UVA-10213)
  9. 凯兑换系统服务器角色,能够在所有局中通用的角色,游走于各个线路,单挑很强的凯...
  10. 【免费毕设】ASP.NET通用作业批改系统设计(源代码+lunwen)
  11. android 引用 project以及下拉刷新开源类库Android-PullToRefresh 的使用
  12. Atitit 嵌入式系统与pc系统的对比 目录 1. 哈佛结构和冯诺依曼结构 普林斯顿结构区 1 2. 中断程序 类库调用 1 3. 指令集 三大流程语句 与 运算语句 赋值语句 1 4. 异
  13. 世界时间与伦敦时间_伦敦政治经济学院LSE 2021申请时间线来了,提交申请
  14. 使用ffmpeg将h264视频文件转Mp4格式保存
  15. 立体合唱声效果器:Roland Cloud JUNO-60 Mac
  16. 喜忧参半的电子烟 究竟是不是一个靠谱的创业机会?
  17. [leetcode] 884. Uncommon Words from Two Sentences
  18. 笔记本启动显示0xc000014c错误--提示缺失win10/system32内部文件
  19. 还不懂PID控制?精华都在这了!
  20. redhat 7中DNS 服务器配置与测试

热门文章

  1. Eclipse BreakPoint断点调试技巧和基本步骤方法
  2. Web应用程序 [/XXX_war_exploded] 注册了JDBC驱动程序 [com.mysql.cj.jdbc.Driver],但在Web应用程序停止时无法注销它。
  3. 【Office】三件套之Word套路
  4. 裁桨研纳铰撼蕉吞字吞汗屠闯汗芳
  5. java面向对象抽象类和接口
  6. 红绿灯记忆游戏-第13届蓝桥杯Scratch选拔赛真题精选
  7. 公开课|“技术+法律”隐私计算如何助力数据合规
  8. zencart1.55stripe信用卡内嵌支付获取卡号
  9. Capital One数据泄露影响1.06亿人,嫌疑人已被捕
  10. 【python】绘制箱体图/蜡烛图/K线图