-
Notifications
You must be signed in to change notification settings - Fork 350
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
Support for kotlin value class in Entities #1093
Comments
It looks like Spring Data JDBC isn't able to obtain the parameter name for the constructor parameter from the byte code. For Java there is a compiler flag to ensure that parameter names are maintained in the byte code. It looks like the Kotlin compiler flag Could you give that a try? |
Thanks for the quick reply. We have java 11 as target.
Stable since kotlin 1.4.30 |
Right now we do not support inline classes. What happens here is that the constructor discoverer detects an argument of type |
It is possible to use Kotlin value classes with Spring Data Relational if you do not use value types as identifiers or query method arguments. Using value types with interface methods leads to name mangling. Annotating interface methods with Another problem resulting from value classes is its variance in wrapper types vs. component type inlining when using nullability (declaration site, component type, nesting of value types). Honestly, we're not convinced that we want to follow down another path leading us through the various quirks of how value classes are implemented on the JVM. |
I'm closing this ticket as the original request of supporting value classes in Entities works. |
@mp911de Im not sure i did understand. How is it supposed to work? |
This does not work on 3.2.4:
|
It would be nice if we could wrap id in a value object, a bit related to #574
Example:
The problem here is that the constructor gets an parameterType for
DefaultConstructorMarker
Which later throws an exception
The text was updated successfully, but these errors were encountered: