Mybatis抛出:Cannot obtain primary key information from the database, generated objects may be incomplete

使用 mybatis generator 生成pojo、dao、mapper时,可能会遇到

Cannot obtain primary key information from the database, generated objects may be incomplete

无法生成主键相关方法

具体详细解决方案有人已经提出了,很长,https://blog.csdn.net/jpf254/article/details/79571396#%E6%9C%80%E7%BB%88%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88

另一个详细解读,http://m.aspku.com/view-326284.html

两个解决方案:

1、MySQL数据驱动使用5.X版本

2、这里记一下简单的解决方法,在数据库连接后面加上 nullCatalogMeansCurrent=true

http://www.mybatis.org/generator/

posted @ 2019-03-18 19:55  一沙世界  阅读(941)  评论(0编辑  收藏  举报