首页 > 数据库技术 > 详细

sqlmap映射继承机制及映射字段顺序与SQL查询字段顺序无关

时间:2014-01-17 08:38:09      阅读:383      评论:0      收藏:0      [点我收藏+]
bubuko.com,布布扣
<typeAlias alias="TblSpPartsinfo" type="com.bn.car.biz.supply.dao.po.PartsInfoPO"/>
    <resultMap class="TblSpPartsinfo" id="TblSpPartsinfoResultMap">
        <result property="id" column="id"/>
        <result property="partsCode" column="parts_code"/>
        <result property="partsName" column="parts_name"/>
        <result property="bigTitle" column="big_title"/>
        <result property="smallTitle" column="small_title"/>
        <result property="storeNum" column="store_num"/>
        <result property="grade" column="grade"/>
        <result property="costPrice" column="cost_price"/>
        <result property="marketPrice" column="market_price"/>
        <result property="retailPrice" column="retail_price"/>
        <result property="weight" column="weight"/>
        <result property="weightUnit" column="weight_unit"/>
        <result property="vol" column="vol"/>
        <result property="volUnit" column="vol_unit"/>
        <result property="partsIntroduce" column="parts_introduce"/>
        <result property="specification" column="specification"/>
        <result property="packagingList" column="packaging_list"/>
        <result property="brandIntroduce" column="brand_introduce"/>
        <result property="usage" column="usage"/>
        <result property="aftersaleService" column="aftersale_service"/>
        <result property="createdDate" column="created_date"/>
        <result property="creater" column="creater"/>
        <result property="modifiedDate" column="modified_date"/>
        <result property="modifier" column="modifier"/>
        <result property="flag" column="flag"/>
        <result property="fPartsbrandId" column="f_partsbrand_id"/>
        
        <result property="fPartstypeId" column="f_partstype_id"/>
        <result property="fSupplyinfoId" column="f_supplyinfo_id"/>
        <result property="updown" column="updown"/>
        <result property="recommend" column="recommend"/>
        <result property="partsSource" column="parts_source"/>
        <result property="fPartstypeId2" column="f_partstype_id2"/>
        <result property="unionFlag" column="union_flag"/>
    </resultMap>
<!-- 组合产品子产品 -->
    <resultMap class="TblSpPartsinfo" id="TblSpPartsinfoResultMapWithUnion" extends="TblSpPartsinfoResultMap">
        <result property="lessPrice" column="less_price"/>
        <result property="newPrice" column="new_price"/>
    </resultMap>
<resultMap class="TblSpPartsinfo" id="TblSpPartsinfoResultMapBaoyang" extends="TblSpPartsinfoResultMap">
        <result property="fCareId" column="f_care_id"/>
        <result property="fCareItemId" column="f_care_item_id"/>
    </resultMap>
bubuko.com,布布扣

注意:extends="TblSpPartsinfoResultMap" 表示继承关系。

映射的字段顺序无关~!!,但是数量,名称与sql查询语句相等,名称写错了会报错,因为映射找不到。

sqlmap映射继承机制及映射字段顺序与SQL查询字段顺序无关

原文:http://www.cnblogs.com/simpledev/p/3522650.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!