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: Omar <email@hidden>
- Date: Wed, 13 Jul 2005 15:07:06 -0400
Thanks Chuck, the awakeFromInsertion event worked just fine, I am
checking if the entity is created before creating it myself and so if I
ever find what I am doing wrong with the "Owns Destination" option, I'll
just remove that code.
Thanks again,
Omar
Chuck Hill wrote:
> It really ought to work if it is a mandatory to-one relationship.
> I've used it. Correctly set up, it does work.
>
> That said, if you want to do this manually, override the
> awakeFromInsertion method on the parent, call
> super.awakeFromInsertion, check that it really did not create the
> child :-), and then create it yourself and set the relationship.
>
> Chuck
>
>
> On Jul 5, 2005, at 5:46 PM, Omar wrote:
>
>> Hi all,
>>
>> I still cannot solve this problem so I was thinking of a workaround
>> such
>> as use an event in ERXGenericRecord to create the mandatory entity in
>> the to-one relationship, I was thinking of using the willInsert as the
>> event for inserting the entity but I can't get that to work either.
>>
>> What event can I use to create the entity in the relationship?
>>
>> Thanks in advance,
>>
>> Omar
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>> 40global-village.net
>>
>> 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