Has anyone used Hibernate successfully with Kotlin...
# server
j
Has anyone used Hibernate successfully with Kotlin? Checked #hibernate but the channel seems pretty dead.
k
I have used it through Spring framework.
j
Have you used abstract classes at all?
k
@Jeff Gulbronson for what? Entity?
s
I have. Do you have a more specific question?
m
+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
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.