Having the following entities:
Parent having List<Child> as member, annotated as following: @Valid @OneToMany(fetch = FetchType.EAGER, cascade = { CascadeType.ALL }, orphanRemoval = true) @JoinColumn(name = "parentId")
Child having parent as member (handled as readonly, never assigned directly), annotated as following: @ManyToOne @JoinColumn(name = "parentId")
When creating a parent entity with a N Child entities, the first entityManager.merge(parent) will return a copy of the parent where all the children do not have the parent set.
Reloading the entity has no effect, only workaround is to clear the session.
|
|