Re: Problem with nested editing contexts
Re: Problem with nested editing contexts
- Subject: Re: Problem with nested editing contexts
- From: Guido Neitzer <email@hidden>
- Date: Mon, 26 Mar 2007 12:50:22 -0600
On 26.03.2007, at 11:16, Chuck Hill wrote:
to avoid null pointer exceptions all over the place (and/or to
avoid having to write lots of code to check that the relationships
were non-null). I took the following steps:
You should never need to worry about that. If the to-many
relationships are null, you have overridden awakeFromInsertion
(and / or awakeFromFetch) and failed to call
super.awakeFromInsertion / awakeFromFetch. EOF automatically sets
these to empty arrays in the super implementation.
What I do to help preventing that, is creating awakeFromInsertion and
awakeFromFetch in my EOGenerator template as a method stub that only
calls super() and has a comment for "initialize your object
here ...". So I only have to put in the code at that place and can't
possibly forget to call super().
cug
_______________________________________________
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