Fix: add support for Kotlin data classes without PersistenceConstructor - #37
Conversation
|
Tests are failing... |
|
Oops, I only tested it in my own project. I'll check it. |
|
Okay, so this was a bit of a puzzle. This is how Spring Data resolves constructors: (taken from reference docs) With this logic now in place, there were two problems with
|
|
Tests pass and I agree with your reasoning and conclusion. I don't remember exactly why I implemented it the way I did other than for no arg entities support - I assume it's lack of time to research the underlying logic at the time. |
|
Cool, thanks! This allows me to use plain data classes in Kotlin without I might have another contribution, I will look into it anytime soon. |
|
FYI, 6.1.1 has been released. |
Thanks for contributing. :) |
When using a Kotlin data class without
PersistenceConstructor, it picks the incorrect internal Kotlin constructor which leads to errors.This improvement uses
PreferredConstructorDiscovererfrom Spring Data Common to find the preferred constructor, which supports Kotlin (source).