Java Mailing List Archive

http://www.gg3721.com/

Home » users.openjpa »

maintaining bi-directional relationships

Adam Hardy

2008-05-07

Replies: Find Java Web Hosting

Author LoginPost Reply
This is a design question really, sorry it's a little OT.

I assume I have responsibility for maintaining parent - child relationships
reflected by the parent.getChildren collection and child.getParent entity at the
point where the change occurs.

Is there a good pattern to implement changes to both the children collection on
the parent and the parent entity on the child?

One approach: setting field-access on the entity mapping, and adding code to the
setters with some sort of mechanism to stop infinite looping.


Thanks in advance
Adam
©2008 gg3721.com - Jax Systems, LLC, U.S.A.