• 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: setUser() vs. setUserRelationship()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: setUser() vs. setUserRelationship()


  • Subject: Re: setUser() vs. setUserRelationship()
  • From: George Domurot <email@hidden>
  • Date: Tue, 02 Aug 2011 08:53:56 -0700

Hi Marius,

This is a great question.  setUserRelationship is a Wonder / EOGenerator template addition.

setUserRelationship will do the job of adding your object to both side of the relationship.  However, let's say the inverse relationship is pointing to tens of millions of other objects.  If you revealed this array, you could use setUser to avoid the penalty of managing the flip-side of the relationship.  However, in that case, you probably shouldn't reveal such an array as an attribute.

-G

On Aug 2, 2011, at 1:21 AM, Marius Soutier wrote:

> Hi,
>
> one thing that's always confused me and which causes a bug every now and then is for a given relationship, let's call it user, two setters are generated:
> * `setUser(User user)`
> * `setUserRelationship(User user)`
> while only one getter `user()` is generated.
>
> When calling `setUser()`, the field in the database is populated, but EOF doesn't understand the relationship was set which causes all kinds of weird bugs. So what's the point of the `setUser()` method?
>
> Thanks,
> - Marius
>
>
> _______________________________________________
> 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

 _______________________________________________
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: setUser() vs. setUserRelationship()
      • From: Kieran Kelleher <email@hidden>
References: 
 >setUser() vs. setUserRelationship() (From: Marius Soutier <email@hidden>)

  • Prev by Date: Re: localizedValueForKey and created keys
  • Next by Date: Re: setUser() vs. setUserRelationship()
  • Previous by thread: setUser() vs. setUserRelationship()
  • Next by thread: Re: setUser() vs. setUserRelationship()
  • Index(es):
    • Date
    • Thread