SpringBoot问题之BindingException:Mapper method ... return null from a method with...

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/yangshuaionline/article/details/88662106

代码:

 //判断表是否存在
    @Select("SELECT table_name FROM information_schema.TABLES WHERE table_name ='AppComment'")
    boolean isHaveTable();

问题:

org.apache.ibatis.binding.BindingException: Mapper method … attempted to return null from a method with a primitive return type (…).

问题原因:返回类型不正确
解决办法:

//判断表是否存在
    @Select("SELECT table_name FROM information_schema.TABLES WHERE table_name ='AppComment'")
    String isHaveTable();

猜你喜欢

转载自blog.csdn.net/yangshuaionline/article/details/88662106