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%20EOGenerator%20Templates/_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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]