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 primary key can not auto_increment #1288

Open
fank243 opened this issue Jan 11, 2019 · 1 comment
Open

mysql primary key can not auto_increment #1288

fank243 opened this issue Jan 11, 2019 · 1 comment

Comments

@fank243
Copy link

fank243 commented Jan 11, 2019

I am using a MySQL database. The table I created is self-growth. The mapped java entity inherits the play.db.jpa.Model class, but when I call the .save() method to save it to the database, The primary key ID is generated by hibernate_sequence, not by the table AUTO_INCREMENT.

@ehud-eshet
Copy link

ehud-eshet commented Mar 22, 2020

If you are using Hibernate 5.x, try the following in application.conf:
hibernate.id.new_generator_mappings=false

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

2 participants