Managing bidirectional associations in my java model
<p>I have a java model where the classes have associations (1 to 1, 1 to n, n to n) that should work in both directions.</p>

<p>Example:
class A has a collection of class B</p>

<p>All instances of B must know, who their parent (A) is. If I change the parent property of B, the association needs to be updated on the other side as well.</p>

<p>I think, writing code, that keeps the associations up to date on both ends is quite tedious and errorprone.</p>

<p>So: Is there a better way of doing this? Is there a java library that can manage bidirectional associations between two objects?</p>
