zoukankan      html  css  js  c++  java
  • org.apache.ibatis.binding.BindingException

    1、异常提示:
    
      org.apache.ibatis.binding.BindingException: Mapper method 'com.artup.dao.WorksDao.selectWorksIsCropCompletedById attempted to return null from a method with a primitive return type (byte).
    
    
    2、原因:在使用 MyBatis 时,写了个查询语句,其返回值设置为了 byte 类型,当从数据库中能够查询到数据时,不会报错;当前查询不到数据时则会抛出此异常,是由于 null 不能够直接转换成 byte 类型导致的,我们可以将返回类型设置为对象 Byte,从而能够接收值为 null 的情况。
    
    
    
    3、解决办法:
    
      3.1 将所有查询到的数据的值都设置为数字;
    
        或者
      3.2 将返回的类型由 byte 改成 Byte 从而能够接收 null 类型的值。
    

      

  • 相关阅读:
    Periodic Strings ( UVA
    Digit Counting ( UVA
    Molar mass ( UVA
    Score ( UVA
    Let the Balloon Rise (STL)
    Tree Recovery (STL)
    安卓simpleadapter问题
    安卓活跃手指问题
    python 问题记录
    设计模式笔记
  • 原文地址:https://www.cnblogs.com/hapday/p/9044270.html
Copyright © 2011-2022 走看看