IBatis Resultmap Error The error happened while setting a property on the result object solution

Source: Internet
Author: User
Tags error code
Error:
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.

This error is a problem in Resultmap. Say that the error occurred when setting a property, but there is no specific description is a kind of error <null error >. Might just

is to assign a null value (double, and so on) to a column that is not NULL, so that you can modify it in Resultmap.
It must have been an exception when Ibatis tried to write null values read from the database to the object properties. The assignment of string type should be no problem, my database Also

There is a double type, and that is the problem, and the remedial measures taken are:
<result column= "rate" jdbctype= "DECIMAL" property= "rate" nullvalue= "0"/>
Null values read from the database are replaced by a value that can be converted to a decimal type or a double type.

Report:

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"/>
<!--this line plus a nullvalue= "0" is OK--

</resultMap>


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.