• 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: Owns destination confusion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Owns destination confusion


  • Subject: Re: Owns destination confusion
  • From: Gary Teter <email@hidden>
  • Date: Thu, 28 Feb 2008 09:03:47 -0800

I think you only get the automatic destination creation behavior if you have "propagates primary key" turned on for that relationship.

On Feb 28, 2008, at 8:50 AM, Florijan Stamenkovic wrote:

Hi all,

I've setup my "ContactJob" entity to relate to "Numbers" and "Address" entities, and to own the relationships. Both are to-one relationships with foreign keys in ContactJob, that do not have the inverse relationship modeled. From my understanding this should cause new "Numbers" and "Address" EOs to be created, inserted, and related to the "ContactJob" as soon as I create and insert an instance of "ContactJob". Am I wrong?

Coding with the above assumption, I get a NullPointerException thrown when I try to access the relationships. I do this soon after the creation of the "ContactJob", once I set the GUI values on it. I call validateForSave() on the ContactJob, which is overriden to call validateForSave() on the "address" and "numbers" relationships. I need to do this coz Address and Numbers have per EO custom validation rules.

I've triple checked my model. The foreign key to Numbers and Address are set to not null. The relationships are both setup as mandatory, cascading, and owns relationship. The only peculiarity of the situation is that the inverse relationships are not modeled, but I can't see how that matters. I've not overriden awakeFromInsertion() in ContactJob...

Any ideas???
Flor

If this is normal and I just misunderstand, then I suppose I can create and insert the Numbers and Address in ContactJob's awakeFromInsertion(), and relate them, so I guess it's fixable. Still, it does not seem normal to me.

-- The Ent visualization project: http://wirehose.com/research/entvisualization



_______________________________________________
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:
    • [SOLVED] Re: Owns destination confusion
      • From: Florijan Stamenkovic <email@hidden>
References: 
 >Owns destination confusion (From: Florijan Stamenkovic <email@hidden>)

  • Prev by Date: Owns destination confusion
  • Next by Date: Re: Search NSArray?
  • Previous by thread: Owns destination confusion
  • Next by thread: [SOLVED] Re: Owns destination confusion
  • Index(es):
    • Date
    • Thread