-
Notifications
You must be signed in to change notification settings - Fork 41.2k
set spring.jpa.properties.hibernate.id.new_generator_mappings=true by default #7612
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
Comments
I think this change has broken DataJpaTestIntegrationTests testEntityManagerPersistAndGetId |
@wilkinsona was about to fix it by adding |
That might be better, I don't know really. Feel free to change it to call |
Reopening to fix the |
Reverting the change for now till we figure out what the best way to fix the tests is. |
I wonder if we should add the The other option is we look at somehow updating the |
you're right, I'll give updating |
It looks like the flyway sample is failing but the build doesn't. Could it be related to this issue? |
yes I believe it is. I have a fix for it on this here. I wasn't totally sure about the best way to fix the samples, so waiting for a review to merge it in. |
Data has been migrated from MySQL and IDs are assigned not matching how Hibernate generates sequences for new IDs. This leads to colliding IDs. https://stackoverflow.com/a/21948674 spring-projects/spring-boot#7612 (comment)
Currently the documentation still states that the property defaults to false for backwards compatibility. line 181 of JpaProperties.java
|
Thanks for spotting that, @LaurenceMommers. I've opened #11064. |
Hibernate has a tendency to throw these warnings in Hibernate 5
setting
spring.jpa.properties.hibernate.id.new_generator_mappings=true
will stop it and is good for new projects, and I believe fine for old projects in most cases. I believe this should be the default in the next major version of Spring Boot's autoconfig, and probably called out in upgrade documentation.The text was updated successfully, but these errors were encountered: