<!--顾客信息表,其中一个顾客对应一个国家,一个顾客对应多个订单-->
<resultMap id="customerResultMap" type="com.mc.dto.Customer">
    <id column="ID" property="id">
    <result column="CUS_NAME" property="cusName">
    <!--顾客和国家关系是:一对一-->
    <association column="country_id" property="Country" javaType="Country">
        <id column="cId" property="id">
        <result column="cName" property=“name”>
    </association>
    <!--顾客和订单关系是:一对多-->
    <collection propety="orders" ofType="com.mc.dto.Order">
        <result column="o_id" property="id">
        <result column="o_price" property="price">
    </collection>
</resultMap>

 

 

相关文章:

  • 2021-09-24
  • 2022-12-23
  • 2022-12-23
  • 2021-12-13
  • 2021-10-08
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-13
  • 2021-06-25
  • 2021-08-17
  • 2021-07-06
  • 2022-12-23
  • 2021-11-27
相关资源
相似解决方案