Re: Stopping EOEntityClassDescription.validateObjectForSave from tripping relationships
Re: Stopping EOEntityClassDescription.validateObjectForSave from tripping relationships
- Subject: Re: Stopping EOEntityClassDescription.validateObjectForSave from tripping relationships
- From: Chuck Hill <email@hidden>
- Date: Thu, 2 Apr 2009 11:05:21 -0700
On Apr 2, 2009, at 7:20 AM, Jeffrey Simpson wrote:
When a EO object is saved
EOEntityClassDescription.validateObjectForSave
will be called on it. This method goes over all the classes
properties and
relationships where it calls validateValueForKey.
Is there a way to stop EOEntityClassDescription from validating
relationships? When it validates a relationship it causes a select to
happen. We noticed this because we have a couple of expensive
relationships
select wise. It is also kind wasteful to have 5 or 6 selects fire
because
you changes a single property.
It needs to ensure that the object is valid. These are probably
mandatory relationships and it is verifying there are members. You
could try implementing
public Object validateValueForKey(Object value, String key)
to not call super for these keys if you think there is no reason to do
so.
A probably better option is to NOT model these relationships, and just
fetch / manage them as needed.
Chuck
--
Chuck Hill Senior Consultant / VP Development
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
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