Re: Expanding Import
Re: Expanding Import
- Subject: Re: Expanding Import
- From: Scott Winn <email@hidden>
- Date: Tue, 7 Mar 2006 15:10:20 -0800
And the big question. . .
3) How do I check the database for an Entity and relate an object
to it when there are potentially a million other objects related
to it?
I think, in a round about way, you have identified the problem. I
will hazard a guess that in your model you have a Certificate ->>
Stations. So as you add a certificate to a station, this reverse
relationship grows ever larger. The solution, is to not include
this relationship in your model or to not make it a class
property. In most cases like this, you really don't need this
relationship or seldom need it. In this case you can mimic it by
fetching the related objects when needed.
This happens because when you save, all the relations will get
takeValueForKey(valueForKey(x), x)'ed, reading all the records in.
The simplest solution - short of disabling the relationship in the
model - is to create a DBC-delegate that returns NSArray.EmptyArray
on dbcShouldFetchObjects() when the items of this destination
entity are involved.
Sounds like a good solution, but being very new to WebObjects I have
no idea how to go about doing that. I am using multiple editing
contexts to store and save imported records as I go along, but I have
never ventured deeper into the data store process than that. Can
anyone show me how to selectively ignore certain relationship values
like Anjo described using databaseContextShouldFetchObjects() ?
Thanks again,
Scott
_______________________________________________
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