1. 当sql连接不上的时候,先检查是否是sql连接缺少时区问题,当连接少了?serverTimezone=UTC 会各种错误。
    比如遇见到的
    Creating a new SqlSession
    SqlSession [[email protected]] was not registered for synchronization because synchronization is not active
  2. Mapper method has an unsupported return type: class com.lee.entity.Employee
    如果sql语句执行成功,那么只是返回类型出了问题。
    出现这样的问题是因为 类型不匹配。
    mybatis整合 遇见的问题
    解决方法:

insert、delete、update操作默认返回一个int类型的整数,将增删改的接口改成int或者void即可。

select操作返回的类型可以是自定义的Map或者是List(目前遇到的),这里等我总结了resultType相关知识再回来补充!

如果有帮助点个赞,一起学习吧!

相关文章:

  • 2021-04-21
  • 2021-12-20
  • 2021-07-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-12
  • 2021-11-13
猜你喜欢
  • 2021-05-11
  • 2021-09-19
  • 2021-08-01
  • 2021-12-07
  • 2022-01-17
  • 2021-12-17
  • 2022-01-06
相关资源
相似解决方案