Thiago
12/07/2017, 8:02 PMr4zzz4k
12/07/2017, 8:21 PMea
12/07/2017, 8:24 PMr4zzz4k
12/07/2017, 8:25 PM@JvmOverloads
annotation on method (constructor in your case) with default arguments on Kotlin side. This will generate one additional method for each substituted default value on Java side.
I.e. for data class C @JvmOverloads constructor(val a: Int = 5, val b: String = "Hello!")
there would be constructors with two, one and zero arguments. That's not really the thing you want probably.
2. Add no-arg
plugin mentioned to answers. Look through the https://kotlinlang.org/docs/reference/compiler-plugins.html#no-arg-compiler-plugin -- it mentions that this plugin specifically creates additional no-arg constructor for JPA to consume. After calling it, JPA will fill your values as fields.Thiago
12/07/2017, 11:10 PM