-
Notifications
You must be signed in to change notification settings - Fork 356
ConversionFailedException on generic Entity Id and custom converter #1842
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
This is indeed correct behavior. Spring Data determines the target type for a conversion. You could bypass the issue with annotating The actual issue however is still present that Spring Data JDBC makes invalid assumptions regarding proper conversion in the code path that attempts to convert We need to fix that. |
IMO the issue is not about confusion about variants, the core problem is that a different converter is used. I register Id<->UUID converter, but a standard String<->UUID converter is used ( But if I understand you correctly, annotating the converter as |
The workaround with
|
We are using Spring Data JDBC and a generic type for entity ID.
For it to work we have a custom converter (see the example below).
Our code works in Spring 3.2.5 but does not in 3.2.8 (and most likely some previous versions too). It throws
I am able to reproduce the behavior using the following code - it passes in 3.2.5 but fails in 3.2.8. In 3.2.5 it correctly calls the custom converter, in later releases it picks a wrong converter and fails.
The text was updated successfully, but these errors were encountered: