Re: EOF being overly helpful.
Re: EOF being overly helpful.
- Subject: Re: EOF being overly helpful.
- From: Art Isbell <email@hidden>
- Date: Mon, 19 Sep 2005 16:21:17 -1000
On Sep 19, 2005, at 3:30 PM, Owen McKerrow wrote:
I have a table called Person which has a to-many relationship with
a table PersonName, which is an optional relationship and Own's
Desition is ticked and has a Batch Fault of 5.
The inverse relationship from PersonName to Person is to-one and
mandatory.
I have a fetch spec in PersonName which I use to get a list names
of members which are currently active.
Now this works fine, it retrives all the records I want in 1 hit.
However it then grabs all 167 people objects associated with these
names, 1 AT A TIME !
So what am I doing wrong ? I understand EOF is trying to be helpful
and grab the People objects for me but this time I don't want it to.
Then you'll probably need to set the Person.personNames
relationship not to be a class property and remove the
Person.personNames accessors from the Person class. Have you tried
doing that? If you need to get a Person's personNames, you'll then
need to fetch all PersonNames whose person relationship equals a
particular Person rather than merely sending this Person a personNames
() message.
In fact Im not even sure what's causing these faults to be fired.
EOF is probably trying to keep the object graph consistent with
the database.
If I can't "turn it off" is there any way I can get it to do it all
in one go instead of object by object.
You might be able to do this by setting the fetch spec to
prefetch "person". But I'd try to eliminate the PersonName.person
fetches, if possible.
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