1.场景:
fyq_share_house 表 和 fyq_sh_tag 表 两张表是一对多的关系, 一个楼盘对应多个标签,在实体类ShareHouse中使用
/**
* 楼盘标签
*/
private List<String> tags ;
来存放多个tag标签.
MyBatis对应的xml配置文件表示为
<collection property="tags" ofType="string">
<constructor>
<arg column="content"/>
</constructor>
</collection>
通过string 的构造函数来接受数据库查找的值,
但是这样有一个缺点,就是重复的数据无法获取到.