Re: Automatically create record in a to-one relationship
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