persistence icon indicating copy to clipboard operation
persistence copied to clipboard

IllegalStateException: Class does not have a primary key

Open margge opened this issue 7 years ago • 1 comments

I am getting this when I am using data classes

data class Task(val id: Long,
                val taskConsecutive: String,
                val activityName: String,
                val siteName: String,
                val taskDescription: String)

It seems we need to support Kotlin types

margge avatar Sep 13 '18 15:09 margge

Try adding the @JvmField annotation to the field: https://kotlinlang.org/docs/reference/java-to-kotlin-interop.html#instance-fields

And maybe this won't work with immutable properties. So I think you might need to use var instead.

casidiablo avatar Sep 13 '18 23:09 casidiablo