selectByExample和selectByExampleWithBLOBs有何区别?

1、问题描述:

    在mybatis逆向工程生成的代码中会有selectByExample 和selectByExampleWithBLOBs 两个方法,这个两个方法有何区别?


2、问题解析:

1>两个方法的返回的resultMap 不同

selectByExample  方法返回:BaseResultMap

selectByExampleWithBLOBs  方法返回:ResultMapWithBLOBs

ResultMapWithBLOBs 定义时,继承了BaseResultMap,并且自己特殊的字段,该字段通常是longvarchar类型,

2>使用场景不同

若检索大字段时,则需要使用selectByExampleWithBLOBs  ,一般情况则使用selectByExample  即可。


猜你喜欢

转载自blog.csdn.net/py_tamir/article/details/80957484