• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Relationship consistency maintenance
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Relationship consistency maintenance
      • From: Simon McLean <email@hidden>
    • Re: Relationship consistency maintenance
      • From: Florijan Stamenkovic <email@hidden>
  • Prev by Date: Re: Update error
  • Next by Date: Re: Update error
  • Previous by thread: Re: Update error
  • Next by thread: Re: Relationship consistency maintenance
  • Index(es):
    • Date
    • Thread