I have A->B->C. Those entities are using property access. In the setters
of the children, I am setting their parents, like this snippet from the
class A:
public void setChildren(List<B> children) {
this.children = children;
for (B b : children) {
b.setParent(this);
}
}
When I try to remove a B (with the relationship severed), eclipselink
tries to insert a duplicate A, throwing an exception.
This seems like a reasonable method, as the bidirectional relationship
does not have to manually be maintained. Can anyone describe why this
occurs so that I might avoid similar pitfalls in the future?