Relationship consistency maintenance
Relationship consistency maintenance
- Subject: Relationship consistency maintenance
- From: Tarun Reddy <email@hidden>
- Date: Sun, 15 Jul 2007 23:25:13 -0600
I have an app where a User has a list of Ideas associated with it. I
use the following code to set that relationship:
aNewIdea.addObjectToBothSidesOfRelationshipWithKey(session.getUser(),
"Ideasuser");
However, unless I add this:
session.getUser().addToIdeas(aNewIdea);
then even though the database is correctly updated, User.getIdeas,
isn't up to date. Is it best practices to have both of these
relationships set? And do I need to go further and do a
aNewIdea.addUser(session.getUser());
to maintain that reverse relationship in memory? Or am I making this
harder than it seems...
Thanks,
Tarun
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden