openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Hardy <adam....@cyberspaceroad.org>
Subject Re: maintaining bi-directional relationships
Date Wed, 07 May 2008 16:59:50 GMT
Oh sorry, I should have said, the app must be JPA-compliant / portable.

Michael Vorburger on 07/05/08 17:44, wrote:
> Why not use OpenJPA Managed Inverses,
> http://openjpa.apache.org/docs/latest/manual/ref_guide_inverses.html ?
> 
> 
> -----Original Message-----
> From: Adam Hardy [mailto:adam.sql@cyberspaceroad.org] 
> Sent: mercredi, 7. mai 2008 17:51
> To: users@openjpa.apache.org
> Subject: maintaining bi-directional relationships
> 
> 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.


Mime
View raw message