Has anyone used Hibernate successfully with Kotlin? Checked #hibernate but the channel seems pretty dead.
k
kenji_otsuka
12/31/2018, 4:13 AM
I have used it through Spring framework.
j
Jeff Gulbronson
12/31/2018, 4:18 AM
Have you used abstract classes at all?
k
kenji_otsuka
12/31/2018, 4:26 AM
@Jeff Gulbronson for what? Entity?
s
Stefan Peterson
12/31/2018, 6:46 AM
I have. Do you have a more specific question?
m
mp
12/31/2018, 8:10 AM
+1 for specific. I`m using data classes a lot(as entities) with SB2(hibernate under the hood) - only issue was MappedSuperClass for some common fields. Other things work as usual
j
Jeff Gulbronson
12/31/2018, 2:53 PM
Sorry about that! I have a class like so
Copy code
@MappedSuperclass
open class TimestampedDbEntity {
@Column(updatable = false)
lateinit var createdAt: DateTime
@Column
lateinit var updatedAt: DateTime
}
But it seems that the variables aren’t being initialized properly when loaded from the database.