Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mysql的驱动版本导致的mapper-generator生成实体类的@Id问题 #463

Closed
springpro opened this issue Nov 13, 2018 · 4 comments
Closed

Comments

@springpro
Copy link

springpro commented Nov 13, 2018

mysql server: 5.7.20
5.x.x驱动正常有@id,6.x,和8.x都没有@id

@qrqhuang
Copy link
Contributor

qrqhuang commented Nov 17, 2018

确实有这个问题, mybatis-generator官方说明中针对MYSQL提供如下解决方案:

generatorConfig.xml

    <jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://localhost/my_schema"
            userId="my_user" password="my_password">
        <property name="nullCatalogMeansCurrent" value=true" />
    </jdbcConnection>

主要是该配置:nullCatalogMeansCurrent

@abel533 abel533 closed this as completed Dec 8, 2018
@RiverFlowsInYourHeart
Copy link

MySQL 8.0.6版本,使用@Id@GeneratedValue(strategy = GenerationType.IDENTITY)后,还是存在不能自动生成ID的问题

@wenjuncao
Copy link

也可以在数据库配置url后面追加nullCatalogMeansCurrent=true

@ZHK1996
Copy link

ZHK1996 commented Apr 4, 2021

连接oracle数据库为什么,老是报Error selecting key or setting result to parameter object. Cause: java.sql.SQLSyntaxErrorException: ORA-00923: 未找到要求的 FROM 关键字,对了我主键是string类型的.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants