Hi everybody :slightly_smiling_face: I am currentl...
# spring
p
Hi everybody 🙂 I am currently trying to model a jpa entity with an immutable non nullable field.
Copy code
@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
abstract class Credential(
        @ManyToOne
        @JoinColumn
        val account: Account
) {

    @Id
    val id = UUID.randomUUID()

    @Column(name = "DTYPE", insertable = false, updatable = false)
    val type: CredentialType
Preferably i would like the type field to be a
val
but unfortunately the field needs to be somewhat initialized. What are my options for such a case?