MyBatis resultMap collection标签 返回基本类型集合 如:List<Long> List<String> List<Integer>等

class xxDTO {
	private Long id;
	private Set<Long> industryIds;
	private Set<Long> labelIds;
}
<resultMap id="articleMap" type="xxDTO" autoMapping="true">
      <result property="id" column="ID"/>
      <collection property="industryIds" ofType="long">
         <result column="IndustryID"/>
      collection>
      <collection property="labelIds" ofType="long">
         <result column="LabelID"/>
      collection>
resultMap>
select xx.ID,a.IndustryID,b.LableID from xx 
	left join a on ..
	left join b on ..

你可能感兴趣的:(mybatis,mybatis)