今天在写Spring Data JPA的时候出现了这样一个问题

Null return value from advice does not match primitive return type for: public abstract boolean

详细报错:

Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.Mon Apr 06 23:33:45 CST 2020
There was an unexpected error (type=Internal Server Error, status=500).
Null return value from advice does not match primitive return type for:
public abstract boolean com.gxuwz.assistant_demo.dao.LoginRepositoryDao.findByUserIdAndPasswordAndRoleId(java.lang.String,java.lang.String,java.lang.Integer)

问题如下:

因为sql语句查询的是userid 有的时候会查询到即返回一个String类型的数据,如果查不到就会返回一个null,而boolean不能接收null所以抛出异常

正确代码如下:

Null return value from advice does not match primitive return type for: public abstract boolean相关推荐

  1. Spring之AOP报错:Null return value from advice does not match primitive return type for

    1.org.springframework.aop.AopInvocationException:Null return value from advice does not match primit ...

  2. spring aop Null return value from advice does not match primitive return type for总结

    Null return value from advice does not match primitive return type for这个一般都是发生在代码做了环绕后. 找到源码抛出这个异常的位 ...

  3. Mybatis中的attempted to return null from a method with a primitive return type (int).异常

    错误截图: org.apache.ibatis.binding.BindingException: Mapper method 'com.shop_demo.dao.AdminDAO.getAdmin ...

  4. attempted to return null from a method with a primitive return type (int).

    错误产生的场景 dao层接口如下 int getResourceDataNumsByTitle(String title); mapper.xml 中sql语句如下 <select id=&qu ...

  5. Mybatis:Mapper method attempted to return null from a method with a primitive return type (int)

    Mybatis中 Mapper method attempted to return null from a method with a primitive return type (int)错误 本 ...

  6. sql报错解决方案:attempted to return null from a method with a primitive return type (int)

    问题现象 idea执行查询数量语句控制台报错:attempted to return null from a method with a primitive return type (int). 解决 ...

  7. 关于mybatis的报错 attempted to return null from a method with a primitive return type (int)

    https://blog.csdn.net/kisscatforever/article/details/77801060 一.前言       在往常敲代码的时候没有留意过int和Integer的区 ...

  8. Mybatis-增删改查踩坑- attempted to return null from a method with a primitive return type (int).

    错误 在编写插入数据时一直报如下错误: attempted to return null from a method with a primitive return type (int). 原来的代码 ...

  9. Mybatis异常错误:Mapper method attempted to return null from a method with a primitive return type (int)

    在mybatis搭建时出现错误:Mapper method attempted to return null from a method with a primitive return type (i ...

最新文章

  1. 属于android动画的是什么,下列选项中,属于Android系统的补间动画的是( )
  2. NumPy - np.meshgrid()
  3. python操作word文档中的图片_Python操作word文档插入图片和表格的实例演示
  4. Thrift初用小结
  5. VC++ 在两个程序中 传递字符串等常量值的方法:使用了 WM_COPYDATA 消息的
  6. ntext字段的替换处理示例--全表替换(作者:邹建)
  7. 遗传算法的matlab代码实现
  8. cisco、华为交换机常用配置对照表
  9. PHP进销存软件源代码ERP多仓储管理系统源码
  10. iOS——Segue的使用
  11. 网易邮箱接收ibm的邮件_在IBM Integration Bus中发送和接收带有大型附件的SOAP消息
  12. Node.js学习--07--项目--注册登录
  13. 微信二维码没有扫描id
  14. 一款安全好用的SSH客户端工具
  15. 森林防火无线监控系统解决方案
  16. express使用中base64编码和解码
  17. 大一新生千万要提前准备好好看的证件照啊
  18. Singer混沌映射(含MATLAB代码)
  19. QSL match_phrase 嵌套查询
  20. 初试禅道(开源版)-安装

热门文章

  1. hdu3613(扩展KMP)
  2. android开发超级群(500人)
  3. 两不同网段主机直连通信过程的建立(3个实验详细分析)
  4. IBM MQ 使用一例
  5. 基于fabric框架区块链实现科学数据出版系统
  6. 在一台服务器绑定多个IP
  7. Linux下进程间通信方式之管道、信号、共享内存、消息队列、信号量、套接字
  8. eclipse+cdt+MinGW
  9. nodejs全局变量第一次没赋值要第二次才有是为什么_【NodeJS】async 和 await 的本质...
  10. 一键部署区块链环境 阿里云发布企业级BaaS服务