• 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
Re: Relationship consistency maintenance
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Relationship consistency maintenance


  • Subject: Re: Relationship consistency maintenance
  • From: Simon McLean <email@hidden>
  • Date: Mon, 16 Jul 2007 08:28:45 +0100

Sounds like a problem with your model to me. When using addObjectToBothSides... you should *never* have to set the back relationship manually.

Simon

On 16 Jul 2007, at 06:25, Tarun Reddy wrote:

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:
40mac.com


This email sent to email@hidden

_______________________________________________ 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
References: 
 >Relationship consistency maintenance (From: Tarun Reddy <email@hidden>)

  • Prev by Date: Re: Relationship consistency maintenance
  • Next by Date: Re: Rapid turnaround?
  • Previous by thread: Re: Relationship consistency maintenance
  • Next by thread: Re: Relationship consistency maintenance
  • Index(es):
    • Date
    • Thread