使用 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/

Mybatis抛出:Cannot obtain primary key information from the database, generated objects may be incomplete的更多相关文章

  1. 解决mybatis generator警告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 ...

  2. spring boot集成mybatis只剩两个sql 并提示 Cannot obtain primary key information from the database, generated objects may be incomplete

    前言 spring boot集成mybatis时只生成两个sql, 搞了一个早上,终于找到原因了 找了很多办法都没有解决, 最后注意到生成sql的时候打印了一句话: Cannot obtain pri ...

  3. Mybatis抛出 Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@f54509]异常

    今天在做Springmvc和spring 时 mybatis 是抛出异常 Closing non transactional SqlSession [org.apache.ibatis.session ...

  4. Database Primary key and Foreign key [From Internet]

    Database Primary key and Foreign key --Create Referenced Table CREATE TABLE Department ( DeptID int ...

  5. AES加密时抛出 Illegal key size or default parameters

    使用AES加密时,当密钥大于128时,代码会抛出java.security.InvalidKeyException: Illegal key size or default parameters Il ...

  6. AES加密时抛出java.security.InvalidKeyException: Illegal key size or def

    原文:AES加密时抛出java.security.InvalidKeyException: Illegal key size or def 使用AES加密时,当密钥大于128时,代码会抛出 java. ...

  7. AES加密时抛出java.security.InvalidKeyException: Illegal key size or default parametersIllegal key size or default parameters

    使用AES加密时,当密钥大于128时,代码会抛出java.security.InvalidKeyException: Illegal key size or default parameters Il ...

  8. MyBatis映射,抛出Cause: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'oid' in 'class java.lang.String'

    原因在于: 在MyBatis中使用动态语句的判断时,传入的参数(parameterType)为Java基本数据类型,获取的结果(resultType)为JavaBean对象,此时就会抛出该异常,此时可 ...

  9. Spring异常抛出触发事务回滚

    Spring.EJB的声明式事务默认情况下都是在抛出unchecked exception后才会触发事务的回滚 /** * 如果在spring事务配置中不为切入点(如这里的切入点可以定义成test*) ...

随机推荐

  1. Visual Studio 2015开发Qt项目实战经验分享(附项目示例源码)

    Visual Studio 2015开发Qt项目实战经验分享(附项目示例源码)    转 https://blog.csdn.net/lhl1124281072/article/details/800 ...

  2. UVA 315 Network (模板题)(无向图求割点)

    <题目链接> 题目大意: 给出一个无向图,求出其中的割点数量. 解题分析: 无向图求割点模板题. 一个顶点u是割点,当且仅当满足 (1) u为树根,且u有多于一个子树. (2) u不为树根 ...

  3. python 配置导入方式

    许多连接,如 from setting import redis_config pool= redis.ConnectionPool(**redis_config) r=redis.Redis(con ...

  4. MySQL5.7.23 VS MySQL5.6.21 分区表性能对比测试

    为评估MySQL从5.6.21升级到5.7.23版本的性能,针对分区表的读写做了对比测试. [测试环境] 1. 两台HP380的物理机,配置一致,CPU:Intel(R) Xeon(R) CPU E5 ...

  5. 说说我安装pyspider遇到的那些坑

    现在python3.7  >>pip install pyspider    配置环境变量 前置的phantomjs 无界面浏览器,设置就不说了 cmd 中运行pyspider all  ...

  6. DataGridView获取或者设置当前单元格的内容

    当前单元格指的是DataGridView焦点所在的单元格,它可以通过DataGridView对象的CurrentCell属性取得.如果当前单元格不存在的时候,返回null. 取得当前单元格的内容: o ...

  7. 在Qt项目中添加全局宏变量来达到按方案编译的目的

    遇到一个需求,需要根据不同需要编译所需程序,本人采用了在QtCreator中建立不同的构建设置,配合宏的方式来实现: 1.在项目-构建设置中,添加构建配置2.在构建步骤里的qmake中的额外参数一栏填 ...

  8. Codeforces.1028F.Make Symmetrical(结论 暴力)

    题目链接 \(Description\) \(q\)次操作,每次给定点的坐标\((x,y)\),表示加入一个点\((x,y)\),或删除一个点\((x,y)\),或询问:至少需要在平面中加入多少个点, ...

  9. Centos ATI 显卡安装,“LCD 信号超出范围” 解决方法

    centso ATI 显卡驱动安装 centos 版本 32位 6.4 Final ATI 显卡版本:Radeon HD 7400 Series 之前由于很久自己安装了centos显卡,分辨率很低不能 ...

  10. [BZOJ3683]Falsita

    [BZOJ3683]Falsita 题目大意: 一个\(n(n\le3\times10^5)\)个结点的树,每个结点有一个权值\(w_i\),\(m(m\le3\times10^5)\)次操作,操作包 ...