• 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: Automatically create record in a to-one relationship
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Automatically create record in a to-one relationship


  • Subject: Re: Automatically create record in a to-one relationship
  • From: Art Isbell <email@hidden>
  • Date: Fri, 24 Jun 2005 11:00:30 -1000

On Jun 24, 2005, at 10:52 AM, Chuck Hill wrote:

That is the right way to do it. Check
1. You did this on the relationship from One to Two and not the other way around
2. You are calling ec.insertObject(one);
3. You have not overridden one.awakeFromInsertion() and forgotten to call super.awakeFromInsertion

If the primary key of the source entity is also the foreign key of the to-one relationship, the relationship must be set to be mandatory, not optional. The primary key (and thus the foreign key) cannot be null, so the to-one relationship value cannot be null, so the relationship cannot be optional. I don't know whether this would affect automatic destination entity row insertion, but making the relationship optional will cause problems.


Aloha,
Art

_______________________________________________
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


References: 
 >Automatically create record in a to-one relationship (From: Omar <email@hidden>)
 >Re: Automatically create record in a to-one relationship (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: Automatically create record in a to-one relationship
  • Next by Date: Re: Webobjects books/place to start?
  • Previous by thread: Re: Automatically create record in a to-one relationship
  • Next by thread: Re: Automatically create record in a to-one relationship
  • Index(es):
    • Date
    • Thread