I found a way to make it work but it feels a bit h...
# spring
p
I found a way to make it work but it feels a bit hakisch to me. I just set the type field to a special
UNKNOWN
value and made the setter private.
Copy code
@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
abstract class Credential(
        @ManyToOne
        @JoinColumn
        val account: Account
) {

    @Id
    val id = UUID.randomUUID()

    @Enumerated(EnumType.STRING)
    @Column(name = "DTYPE", insertable = false, updatable = false)
    var type: CredentialType = CredentialType.UNKNOWN
        private set