I have a scenario where I’m using the relationship @OneToMany bidirectional with hibernate, doing that I have the reference of the ID from my entity ServiceOrder in my entity ClinicalProcedure, the problem is when I try to persist the properties from my entity ServiceOrder the property that it’s annotated with @OneToMany it’s not persisting the id reference in my entity ClinicalProcedure, does anyone can help me with that? This is my project on GitHub
Changing a mappedBy
association does not make an entity dirty, so if you want to assign a ClinicalProcedure
to a ServiceOrder
, you will have to persist a ClinicalProcedure
that refers to an existing ServiceOrder
.