美文网首页
mybatis自动生成代码只有insert()和insertSe

mybatis自动生成代码只有insert()和insertSe

作者: oldweipro | 来源:发表于2020-01-16 21:55 被阅读0次

背景介绍

在使用Mybatis自动生成代码功能时,出现提示Cannot obtain primary key information from the database, generated objects may be incomplete,导致Mapper下只有insert()和insertSelective(),其余update(),delete(),select()方法都没有生成自动生成,使用的Mybatis版本为3.4.6,mysql-connector-java版本为8.0.13(解决方案在总结中,可直接使用)

解决方案

在jdbc url后增加nullCatalogMeansCurrent=true即可(但此时不会生成withBLOBs类)

具体分析

@pfjia的这篇文章有详细分析

Mybatis-mybatis自动生成代码提示"Cannot obtain primary key information from ..."解决方案

相关文章

网友评论

      本文标题:mybatis自动生成代码只有insert()和insertSe

      本文链接:https://www.haomeiwen.com/subject/oewqqqtx.html