I am developing with Kotlin and JPA recently. I use Kotlin data class as JPA @Entity class.
But now, There comes some problem with relation
@ManyToOne(fetch = FetchType.LAZY, optional = true)
懒惰获取不适用于数据类.
I have learned that Kotlin data class is default to be 'final' so that Hibernate can't generate proxy for them.
I wonder is this a mistake to use Kotlin data class as JPA @Entity class or there is other ways to make the lazy fetching work properly with data class.