• 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: Can't get automatic inverse relationships to work
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can't get automatic inverse relationships to work


  • Subject: Re: Can't get automatic inverse relationships to work
  • From: Mike Schrag <email@hidden>
  • Date: Wed, 8 Oct 2008 12:58:37 -0400

Are you using the newer wonder eogen file that talks about automatic inverse updating?

Your underscore file for a to-one should look roughly like:

public er.attachment.model.ERAttachment avatar() {
return (er.attachment.model.ERAttachment)storedValueForKey("avatar");
}


  public void setAvatar(er.attachment.model.ERAttachment value) {
    takeStoredValueForKey(value, "avatar");
  }

public void setAvatarRelationship(er.attachment.model.ERAttachment value) {
if (_Person.LOG.isDebugEnabled()) {
_Person.LOG.debug("updating avatar from " + avatar() + " to " + value);
}
if (er .extensions .eof .ERXGenericRecord .InverseRelationshipUpdater.updateInverseRelationships()) {
setAvatar(value);
}
else if (value == null) {
er.attachment.model.ERAttachment oldValue = avatar();
if (oldValue != null) {
removeObjectFromBothSidesOfRelationshipWithKey(oldValue, "avatar");
}
} else {
addObjectToBothSidesOfRelationshipWithKey(value, "avatar");
}
}




On Oct 8, 2008, at 12:35 PM, Fredrik Lindgren wrote:

I use all this in my app:

extend ERXApplication
extend ERXSession
extend ERXGenericRecord

use ERXEC.newEditingContext()

In properties i do this:
er.extensions.ERXEC.safeLocking=true
er.extensions.ERXEnterpriseObject.updateInverseRelationships=true

When a set a one relationship from a form (without using the setXXXRelationship) the relationship does not update on the other side!

When using the setXXXRelationship it all works.

Am I missing something?

Regards
/Fredrik
_________________________________________________________________
drop, Kålsängsgränd 10 B, 753 19 UPPSALA, Sweden
_______________________________________________
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: Can't get automatic inverse relationships to work
      • From: Anjo Krank <email@hidden>
References: 
 >Can't get automatic inverse relationships to work (From: Fredrik Lindgren <email@hidden>)

  • Prev by Date: Re: How do I secure the session cookie? [was Re: General session questions...]
  • Next by Date: Re: Open page in a popup window
  • Previous by thread: Can't get automatic inverse relationships to work
  • Next by thread: Re: Can't get automatic inverse relationships to work
  • Index(es):
    • Date
    • Thread