侧边栏壁纸
博主头像
码森林博主等级

一起走进码森林,享受编程的乐趣,发现科技的魅力,创造智能的未来!

  • 累计撰写 146 篇文章
  • 累计创建 74 个标签
  • 累计收到 4 条评论

目 录CONTENT

文章目录

【MyBatis】The content of element type "resultMap" must match "(constructor?,...

码森林
2022-08-11 / 0 评论 / 0 点赞 / 838 阅读 / 547 字 / 正在检测是否收录...
温馨提示:
本文最后更新于 2022-08-11,若内容或图片失效,请留言反馈。部分素材来自网络,若不小心影响到您的利益,请联系我们删除。

错误

mybatis 错误,xxx.xml配置文件报这样的错误,具体错误,如下所示:

The content of element type "resultMap" must match "(constructor?,id*,result*,association*,collection*,discriminator?)".

原因

<resultMap>标签需要按照以下顺序来进行排列,不然就会出现上述的错误。

<id>

<result>

<association>

<collection>

正确示例

<resultMap id="OrderBOResultMap" type="com.feixiang.athena.elecard.simple.card.entity.bo.OrderBO">
        <result column="order_status" property="orderNo"/>
        <result column="create_time" property="createTime"/>
        <result column="order_status" property="orderStatus"/>
        <result column="company_id" property="companyId"/>
        <result column="pick_status" property="pickStatus"/>
        <association property="site" javaType="com.feixiang.athena.elecard.simple.card.entity.bo.OrderBO$Site">
            <result column="site_id" property="siteId"/>
            <result column="site_name" property="siteName"/>
        </association>
        <association property="amount" javaType="com.feixiang.athena.elecard.simple.card.entity.bo.OrderBO$Amount">
            <result column="original_goods_price" property="originalGoodsPrice"/>
            <result column="original_freight_price" property="originalFreightPrice"/>
            <result column="original_order_price" property="originalOrderPrice"/>
            <result column="current_goods_price" property="currentGoodsPrice"/>
            <result column="current_freight_price" property="currentFreightPrice"/>
            <result column="current_order_price" property="currentOrderPrice"/>
            <result column="goods_discount_amount" property="goodsDiscountAmount"/>
            <result column="freight_discount_amount" property="freightDiscountAmount"/>
            <result column="order_discount_amount" property="orderDiscountAmount"/>
            <result column="payable_amount" property="payableAmount"/>
            <result column="c" property="paidAmount"/>
        </association>
        <collection property="cardList" ofType="com.feixiang.athena.elecard.simple.card.entity.bo.OrderBO$Card">
            <result column="card_stock_id" property="cardStockId"/>
            <result column="card_stock_number" property="cardStockNumber"/>
            <result column="card_stock_positive_image" property="cardStockPositiveImage"/>
            <result column="card_stock_name" property="cardStockName"/>
            <result column="card_stock_type" property="cardStockType"/>
            <result column="process" property="process"/>
            <result column="material" property="material"/>
            <result column="card_stock_money" property="cardStockMoney"/>
            <result column="unit_price" property="unitPrice"/>
            <result column="purchase_price" property="purchasePrice"/>
            <result column="quantity" property="quantity"/>
        </collection>
    </resultMap>
0

评论区