?我們先來看一段MyBatis逆向工程生成的代碼。
<select id="selectByExample" parameterType="cn.e3mall.pojo.TbItemDescExample" resultMap="BaseResultMap">
<select id="selectByExampleWithBLOBs" parameterType="cn.e3mall.pojo.TbItemDescExample" resultMap="ResultMapWithBLOBs">
我們可以發(fā)現(xiàn),resultMap不同。
?接下來我們在看resultMap的內(nèi)容。

selectByExampleWithBLOBs的resultMap:

對比之后我們可以看出selectByExampleWithBLOBs的返回值ResultMapWithBLOBs是繼承自selectByExample的返回值BaseResultMap,他擁有BaseResultMap的全部屬性。
1、兩個(gè)方法的返回的resultMap 不同
selectByExample??方法返回:BaseResultMap。
selectByExampleWithBLOBs??方法返回:ResultMapWithBLOBs。
ResultMapWithBLOBs 定義時(shí),繼承了BaseResultMap,并且自己特殊的字段,該字段通常是longvarchar類型。
2、使用場景不同
若檢索大字段時(shí),則需要使用selectByExampleWithBLOBs??,一般情況則使用selectByExample??即可。