• 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: EOGenerator Relationships
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EOGenerator Relationships


  • Subject: Re: EOGenerator Relationships
  • From: Mike Schrag <email@hidden>
  • Date: Wed, 17 Sep 2008 11:46:13 -0400

Wonder's automatic inverse relationship stuff
What's that? Mind explaining briefly, or pointing out where it is in wonder?
On ERXGenericRecord:

 * Also, this class supports auto-updating of inverse relationships. You can
 * simply call <code>eo.setFoo(other), eo.takeValueForKey(other),
 * eo.addObjectToBothSidesOfRelationshipWithKey(other, "foo")</code>
 * or <code>eo.addToFoos(other)</code> and the inverse relationship will get
 * updated for you automagically, so that you don't need to call
 * <code>other.addToBars(eo)</code> or <code>other.setBar(eo)</code>. Doing
 * so doesn't hurt, though. Giving a <code>null</code> value of removing the
 * object from a to-many will result in the inverse relationship getting
 * cleared. <br />
 * If you *do* call addToBars(), you need to use
 * includeObjectIntoPropertyWithKey() in this method.<br>
 * This feature should greatly help readability and reduce the number errors you
 * make when you forget to update an inverse relationship. To turn this feature
 * on, you must set the system default
 * <code>er.extensions.ERXEnterpriseObject.updateInverseRelationships=true</code>.

The _Wonder.java templates check for this and can function in both scenarios properly.  What this basically addresses are for things like where you bind a WOPopUpButton selection to a to-one relationship.  All that does is set one side of the relationship, which is terribly confusing for people.  This setting makes it so inverse relationships are always updated.  There was a great debate about this a few months ago, actually ... You can search the archives for it.

call super.setXxx

As far as I can see your _Entity (http://webobjects.mdimension.com/wolips/EOGenerator/Velocity EOGenerator Templates/_Entity.java) does not have setXxx(...) for relationships. So, why is that?
I don't think you actually need them ... EOF will do the right thing in the absence of the non-XxxRelationship set methods.  That said, I don't actually use those templates -- I use _Wonder.java, but the addition of the setXxx methods I think is pretty recent (I think I only added them when I fixed automatic inverse relationship updating).

ms
 _______________________________________________
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: EOGenerator Relationships
      • From: Florijan Stamenkovic <email@hidden>
References: 
 >EOGenerator Relationships (From: Michael Kondratov <email@hidden>)
 >Re: EOGenerator Relationships (From: David Avendasora <email@hidden>)
 >Re: EOGenerator Relationships (From: Florijan Stamenkovic <email@hidden>)
 >Re: EOGenerator Relationships (From: David Avendasora <email@hidden>)
 >Re: EOGenerator Relationships (From: Michael Kondratov <email@hidden>)
 >Re: EOGenerator Relationships (From: Mike Schrag <email@hidden>)
 >Re: EOGenerator Relationships (From: Florijan Stamenkovic <email@hidden>)

  • Prev by Date: Re: EOGenerator Relationships
  • Next by Date: Re: EOGenerator Relationships
  • Previous by thread: Re: EOGenerator Relationships
  • Next by thread: Re: EOGenerator Relationships
  • Index(es):
    • Date
    • Thread