I would add it by hand to your Entity.java file.  ;-)



On Apr 28, 2009, at 1:10 PM, Mr. Frank Cobia wrote:

Thanks. I was going to just remove the reverse relationship, but there is actually a place where I do a query that uses the inverse relationship. So my solution, which seems to work, is to remove the class property flag for the inverse relationship. The only downside I have come across is that there is then no ERXKey generated for that inverse relationship.

Is there a way to have an ERXKey generated for a non-class property or am I stuck adding it by hand?

Thanks,
Frank


On Apr 28, 2009, at 11:06 AM, Mike Schrag wrote:

currently not directly .. it's an all-or-nothing setting. you would need to remove the inverse relationship from the model to turn it off. you MIGHT be able to manually do a _setUpdateInverseRelationships(false) (or whatever that method is called) on the EO before you set the relationship in question, but make sure you put the thing to turn it back on in a finally block.

ms

On Apr 28, 2009, at 10:59 AM, Mr. Frank Cobia wrote:

Sorry, I need a little more help. I understand this, but I would like to keep the updateReverseRelationships=true for the app, but in one situation I would like to set the relationship without updating the reverse. Is it possible to do this?

Thanks,
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/mschrag%40mdimension.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/frank.cobia%40f2technology.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/rparada %40mac.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]

Reply via email to