-
Notifications
You must be signed in to change notification settings - Fork 132
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 auto_increment not returned after save() #486
Comments
I'm not sure, but it sounds similar to spring-projects/spring-data-relational#1274 |
Auto-generated Id's should be returned by issuing |
After #444, non-nullable fields should be working in kotlin. |
I wasn't able to reproduce the issue. |
I just ran my test with spring-boot:2.4.0-M4 and spring-data-r2dbc:1.2.0-RC2 and it worked as expected. Sorry for the duplicate. |
As for almost all cases, the id of my entity will not be null, I want to define that field as such in Kotlin:
When I save a new entity with repository's save() method, it gets INSERTed as expected, with a new id auto_generated by the database. However, the returned entity still has an id of 0, and not the generated value.
If I change the entity declaration with a null id, and use null as id for the new entity, this is not the case, and the returned entity has the new id.
Experiments with implementing interface Persistable did not lead to different results.
The text was updated successfully, but these errors were encountered: