iBatis resultMap出错 The error happened while setting a property on the result object 解决办法 .
来源:互联网 发布:淘宝客好用吗 编辑:程序博客网 时间:2024/06/01 07:37
错误:
org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL [];
SQL state [null]; error code [0];
--- The error occurred in com/sinosoft/para/conf/A_T_4_SqlMap.xml.
--- The error occurred while applying a result map.
--- Check the A_T_4.A_T_4Result.
--- The error happened while setting a property on the result object.
--- Cause: net.sf.cglib.beans.BulkBeanException; nested exception is
com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/sinosoft/para/conf/A_T_4_SqlMap.xml.
--- The error occurred while applying a result map.
--- Check the A_T_4.A_T_4Result.
--- The error happened while setting a property on the result object.
这个错误是resultMap里有问题。说错误发生在设置某一个属性的时候,但是没有具体说明是一个怎么样的错误<NULL错误>。可能就
是把某一列中不为null的值赋了null值(double等),这样的话在resultMap里面作修改就行了。
肯定是iBatis试图把从数据库读出来的NULL 值写入对象属性的时候出现异常。String类型的赋值应该没问题,我的数据库中还
有double类型的,那就是这个问题了,采取的补救措施就是:
<result column="RATE" jdbcType="DECIMAL" property="rate" nullValue="0"/>
对从数据库读出来的NULL值采用一个相应可转换为DECIMAL类型或者double类型的值来替换
附:
sqlMap:
<resultMap class="com.sinosoft.para.bean.A_t_4_6" id="A_T_4_6Result">
<result property="id" column="user_id"/>
<result column="RATE" jdbcType="DECIMAL" property="rate" nullValue="0"/>
<!--这一行加一个nullValue="0"就OK了-->
</resultMap>
org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL [];
SQL state [null]; error code [0];
--- The error occurred in com/sinosoft/para/conf/A_T_4_SqlMap.xml.
--- The error occurred while applying a result map.
--- Check the A_T_4.A_T_4Result.
--- The error happened while setting a property on the result object.
--- Cause: net.sf.cglib.beans.BulkBeanException; nested exception is
com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/sinosoft/para/conf/A_T_4_SqlMap.xml.
--- The error occurred while applying a result map.
--- Check the A_T_4.A_T_4Result.
--- The error happened while setting a property on the result object.
这个错误是resultMap里有问题。说错误发生在设置某一个属性的时候,但是没有具体说明是一个怎么样的错误<NULL错误>。可能就
是把某一列中不为null的值赋了null值(double等),这样的话在resultMap里面作修改就行了。
肯定是iBatis试图把从数据库读出来的NULL 值写入对象属性的时候出现异常。String类型的赋值应该没问题,我的数据库中还
有double类型的,那就是这个问题了,采取的补救措施就是:
<result column="RATE" jdbcType="DECIMAL" property="rate" nullValue="0"/>
对从数据库读出来的NULL值采用一个相应可转换为DECIMAL类型或者double类型的值来替换
附:
sqlMap:
<resultMap class="com.sinosoft.para.bean.A_t_4_6" id="A_T_4_6Result">
<result property="id" column="user_id"/>
<result column="RATE" jdbcType="DECIMAL" property="rate" nullValue="0"/>
<!--这一行加一个nullValue="0"就OK了-->
</resultMap>
- iBatis resultMap出错 The error happened while setting a property on the result object 解决办法
- iBatis resultMap出错 The error happened while setting a property on the result object 解决办法 .
- iBatis resultMap出错 The error happened while setting a property on the result object 解决办法
- RuntimeError: ('The following error happened while compiling the node
- The error occurred while setting parameters
- ### The error occurred while setting parameters
- The error occurred while setting parameters
- 使用mybatis报错The error occurred while setting parameters的终极解决办法
- ibatis单元测试出现The error occurred while loading SqlMap -initialize type alias解决办法
- iBatis插入数据时报错The error occurred while applying a parameter map
- ibatis与springmvc出现Check the result mapping for the 'xxx' property的错误
- The error may involve XXX(包)-Inline && The error occurred while setting parameters
- Setting the background image on a webpart title
- ibatis resultMap result中的resultMap问题
- Setting the Master Configuration on the Slave
- Apache [error] server reached MaxClients setting, consider raising the MaxClients setting问题及解决办法
- Apache [error] server reached MaxClients setting, consider raising the MaxClients setting问题及解决办法
- Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The s
- Android Looper和Handler分析 .
- Java初学者---Java的学习路径(全集)
- spring quartz配置
- log4j配置详解
- MAC开发使用第三方证书
- iBatis resultMap出错 The error happened while setting a property on the result object 解决办法 .
- CSS3 transition与animation
- android View 的ontouch事件传递过程
- 软件测试
- Android的TextView使用Html来处理图片显示、字体样式、超链接等
- C++11 FAQ中文版:auto – 从初始化中推断数据类型
- Domino Http 活动线程数的推荐设置
- CSS border-collapse 属性
- C++11 FAQ中文版:枚举类——具有类域和强类型的枚举