Heya! I am using `spring-data-jpa` in my project....
# spring
d
Heya! I am using
spring-data-jpa
in my project. In some of my entities I am defining associations as a
lateinit
fields. Like so:
Copy code
@Entity
data class Example(...) {
    ...
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "anotherId", insertable = false, updatable = false)
    lateinit var another: AnotherEntity
}
However, it seems like hibernate does not really play well
latenit
field. After I do
repository.save(example)
, if I try to access
another
field I get
lateinit property has not been initialized
. Did anyone encountered such problem before?