<select id="getList" resultType="com.test.AClass">
SELECT
b.id,
b.sth
FROM
a
LEFT JOIN b ON a.id = b.id
</select>
比如以上這段代碼,如果a表和b表左聯,如果返回的b.id和b.sth都爲null,那麼getList這個方法返回的List<AClass>裏面就會有null的對象,如果直接遍歷List<AClass>取數據的話,就會報NullPointerException