-
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
Allow consumption of generated values beyond generated keys upon INSERT
#673
Comments
The SQL server driver returns only identifiers for |
So in order to use UUIDs, one has to programatically generate them before persisting? |
Yes and beyond that, for every |
I see, I guess to stay simple I will just avoid default values in the database itself, |
Let's keep this issue open as other databases (e.g. Postgres) can automatically echo the entire inserted row without additional interaction. It would be neat if Spring Data could benefit from such behavior across multiple databases. |
INSERT
I am migrating from h2 driver to mssql driver and have problem with returning the id after saving.
Problem happens also with writing foreign keys via custom write converters.
It first seemd like the id generation happens after r2dbc converters do their job but when i completely removed them and temporary adapted entities to not contain nested entities, I figured out that the generated ids are not returned at all.
How am I then supposed to gather generated id if not immediately after creation?
This all worked just fine with h2 with uuid() function in the flyway script
however with the MSSQL NEWID() function i keep getting null, however in the database values are persisted.
Flyway:
Repository:
public interface FooRepository extends ReactiveCrudRepository<Foo, String>{}
Entity:
And so in the pipeline it looks like this:
Not sure if it is a bug or I lack something.
The text was updated successfully, but these errors were encountered: