<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