Thank you. That fixed it. I did have it backwards.
Frank
On Apr 28, 2009, at 10:23 AM, David Avendasora wrote:
Hi Frank,
On Apr 28, 2009, at 10:12 AM, Mr. Frank Cobia wrote:
If I am using the EOGenerator files from WOLips is there not a way
to update a relationship without automatically updating the inverse
relationship? If I just call setProperty() then the inverse
relationship will get called.
I believe this will only update the inverse if you have the
er.extensions.ERXEnterpriseObject.updateInverseRelationships=true
set. Otherwise it should only call takeStoredValueForKey(aValue,
"Property") and stop.
I had thought if I called setPropertyRelationship() with
er.extensions.ERXEnterpriseObject.updateInverseRelationships=false
I would get the desired behavior, but it seems that
setPropertyRelationship() always updates the inverse relationship.
You have it backwards. The setPropertyRelationship() _explicitly_
sets the inverse, and the updateInverseRelationship will have no
effect on it.
So, in short, if you want to have control over setting one side only
of a relationship, use either of the following _Without_ the
updateInverseRelationship=true:
takeStoredValueForKey(aValue, "Key");
or
setProperty(aValue);
Dave
For example:
public void
setSetasideCodeRelationship(com.ods.wo.bids.db.SetasideCode value) {
if (_Bid.LOG.isDebugEnabled()) {
_Bid.LOG.debug("updating setasideCode from " + setasideCode()
+ " to " + value);
}
if
(er
.extensions
.eof
.ERXGenericRecord
.InverseRelationshipUpdater.updateInverseRelationships()) {
setSetasideCode(value);
}
else if (value == null) {
com.ods.wo.bids.db.SetasideCode oldValue = setasideCode();
if (oldValue != null) {
removeObjectFromBothSidesOfRelationshipWithKey(oldValue,
"setasideCode");
}
} else {
addObjectToBothSidesOfRelationshipWithKey(value,
"setasideCode");
}
}
So even if
er.extensions.ERXEnterpriseObject.updateInverseRelationships is
false it still calls either
addObjectsToBothSidesOfRelationshipWithKey() or
removeObjectFromBothSidesOfRelationshipWithKey(). Is this correct?
If so, is there a way to do this through the generated files?
Thanks,
Frank
_______________________________________________
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/webobjects%40avendasora.com
This email sent to [email protected]
_______________________________________________
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]