MyBatis Generator版本:1.3.5
MyBatis Generator在Mapper接口中(由javaClientGenerator生成),只生成了:
deleteByPrimaryKey()
insert()
insertSelective()
未能生成以下方法:
selectByPrimaryKey()
updateByPrimaryKey()
updateByPrimaryKeySelective()
原因
特殊数据库表设计:当MySQL的表只有一个字段(该字段为主键)时,会出现这种情况。
可能是MyBatis Generator的BUG。
简易解决方法
给该表增加一列(非主键)即可。