I want to model this:
I doubt that this is right:
@Entity data class(@OneToOne val group: Group, @OneToOne val subgroup: Subgroup)
I want to model this:
I doubt that this is right:
@Entity data class(@OneToOne val group: Group, @OneToOne val subgroup: Subgroup)
It's relating to JPA more than kotlin language. You can reference this: Mapping ManyToMany with composite Primary key and Annotation: