On the importance of code specification

Source: Internet
Author: User
Code Specification

Things are not big, but when it happens, there will be bugs, how to debug their own do not come out.
The thing is this: the big night of the Cheerful debugging code, and nothing, just want to debug the HAP framework of the query.

<?xml version= "1.0" encoding= "UTF-8"?> <! DOCTYPE Mapper Public "-//mybatis.org//dtd mapper 3.0//en" "Http://mybatis.org/dtd/mybatis-3-mapper.dtd" > < Mapper namespace= "Com.hand.core.demo.mapper.HapOrgCompanysMapper" > <resultmap id= "baseresultmap" type= " Com.hand.core.demo.dto.HapOrgCompanys "> <result column=" company_id "property=" CompanyID "jdbctype=" DECIMAL "/ > <result column= "company_number" property= "Companynumber" jdbctype= "VARCHAR"/> <result colum N= "Company_Name" property= "CompanyName" jdbctype= "VARCHAR"/> </resultMap> <sql id= "Base_column_list" &
        Gt Company_id,company_number,company_name </sql> <select id= "FindAll" parametertype= "Com.hand.core.demo.dto". Haporgcompanys "resultmap=" Baseresultmap "> select <include refid=" Base_column_list "/> from Hap_or G_companys </select> </mapper> 
above is the MyBatis configuration file, the file does not write a problem (see there is no), such as:
<result column= "company_id" property= "CompanyID" jdbctype= "DECIMAL"/>

Column corresponds to the field of the database, CompanyID corresponding to the entity class Haporgcompanys field, directly are copied over, but in the run, the total error, CompanyID in the entity class Haporgcompanys can not find, How to debug all is so, finally helpless to the entity class CompanyID field changed to company_id, incredibly again can ... I am also very desperate, do not know why. and then this morning to debug, suddenly heard the hump naming rules, holding a trial mentality, the CompanyID changed to CompanyID. Incredibly can, can, can.

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.