Mybatis Notes - multi-table association

Entity classes: AntennaSystem

Add the required associated entities

private List<ExtendedAttr> extendedAttrs;

AntennaSystemMapper.xml

Associate entity

<collection property="deviceModelAttr" ofType="com.bonc.industry.txsp.entity.DeviceModelAttr">
    <id property="modelAttrId" column="model_attr_id"/>
    <result property="dmAttrType" column="dm_attr_type"/>
    <result property="attrValue" column="attr_value"/>
    <result property="modelId" column="model_id"/>
</collection>

Guess you like

Origin www.cnblogs.com/junzifeng/p/11796577.html