抽时间写个MyBatis Generator plugin,生成selectBySampleSelective接口和相应的xml select元素。selectBySampleSelective方法使用一个样本实体记录,通过对sample样本存在的字段与表相应字段做相等比较来检索表记录。虽然selectByExample方法完全可以满足要求,但selectByExample实在太重量级了。

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.