假設(shè)有如下表table:
id | str ---|--- 1| B 1| A
sql:
select id, str from table order by str;
顯然會返回:
id | str ---|--- 1| A 1| B
考慮如下mybatis mapper:
<resultMap type="someType" id="rm"> <id property="id" column="id" /> <collection property="strs" ofType="String"> </collection> </resultMap>
屬性id為1,屬性strs類型為List<String>
,它的值一定會是["A","B"]
嗎?