I'm trying to use Spring Data JDBC with Kotlin data-classes, and after adding @Transient
property to primary constructor I received error on simple findById
call:
java.lang.IllegalStateException: Required property transient not found for class mitasov.test_spring_data_with_kotlin.Entity!
my entity class looks like below:
data class Entity(
@Id
var id: String,
var entityName: String,
@Transient
var transient: List<TransientEntity>? = mutableListOf(),
)
After reading that issue I've tried to make @PersistenseConstructor
without @Transient
field:
data class Entity(
@Id
var id: String,
var entityName: String,
@Transient
var transient: List<TransientEntity>? = mutableListOf(),
) {
@PersistenceConstructor
constructor(
id: String,
entityName: String,
) : this(id, entityName, mutableListOf())
}
But this didn't help me and I'm still getting that error.
How can I solve this problem?