zoukankan      html  css  js  c++  java
  • ibatis 更改resultmap后 java.sql.SQLException: Column 'del_status' not found.

    当在resultmap中增加字段后,查询语句也必须增加相应字段,否则会报错,

    java.sql.SQLException: Column 'del_status' not found.

    因为查询结果与resultmap对应不上,ibatis在查询获得结果集中找不到resultmap的对应字段,

    我是在resultmap中增加字段,但select语句中并没有增加,折腾了半天

    如果属性类型为基本类型而非包装类型,并且数据库中数据为null,那么就会报错

    Caused by: java.lang.RuntimeException:

    Error setting property 'setTagId' of 'com.ginkgocap.ywxt.knowledge.model.KnowledgeColumn@16c1227'.

     Cause: java.lang.IllegalArgumentException

    这种情况很容易发生,比如在表中增加一个数字类型字段,对应的java属性是基本类型,就会出现

    因此建议使用包装类型,遇到null类型数据就不会报错,否则数据库中就必须有值,即不为空,我看公司设计的其它数字字段都不能为空。

  • 相关阅读:
    【背包专题】K
    【背包专题】J
    【背包专题】H
    【背包专题】C
    5972: 【递归入门】全排列
    51nod 1136 欧拉函数【数论】
    【背包专题】G
    【背包专题】I
    【背包专题】F
    各浏览器的Hack写法
  • 原文地址:https://www.cnblogs.com/stit/p/3958444.html
Copyright © 2011-2022 走看看