错误
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>
评论区