Tag:Resultmap complex type

  • How mybatis uses resultmap to map complex type list

    Time:2021-10-18

    Mybatis resultmap complex type list mapping Mapping generics to objects xml <resultMap type=”com.mdm.skr.mdm_common.dto.StrategyInternetDataDTO”> <id property=”id” column=”id” jdbcType=”INTEGER”/> <result property=”internetData” column=”internet_data” jdbcType=”INTEGER”/> <collection property=”userList” ofType=”com.mdm.skr.mdm_common.entity.SysUser”> <id property=”id” column=”id” jdbcType=”INTEGER”/> <result property=”number” column=”number” jdbcType=”VARCHAR”/> <result property=”pushToken” column=”push_token” jdbcType=”VARCHAR”/> <result property=”wsChannelId” column=”ws_channel_id” jdbcType=”VARCHAR”/> </collection> </resultMap> <select resultMap=”internetDataDTO”> SELECT sidu.id, sidu.internet_data, su.id, su.number, su.push_token, su.ws_channel_id FROM strategy_internet_data_user sidu JOIN […]