It's not the model, it's a faulting issue (it's been a while since I've worked in wo, so bare with me).

When I called the method it was still a fault (hence the _EOCheapCopyMutableArray, instead of a filled-in array). My method now looks like:

    public NSArray events() {
        NSArray events = (NSArray)storedValueForKey("events");
events.count(); //this forces EOF to read the database and create objects.
        return events;
    }

This works, but is there a "cleaner" way of doing this? Something like willRead() but equivalent for arrays? I know I could do

if(events instanceof _EOCheapCopyMutableArray) {
        ((_EOCheapCopyMutableArray)events).willRead()
}

but that's really ugly. Please enlighten :) ... what's the standard way of dealing with this?

Oh and one more thing: I was wrong about this being a displaygroup- only issue.. it comes up anytime this object is used and before it's been fetched (into the databasestore or something) the first time.

Thanks, Jacob




On 4-Aug-07, at 6:43 PM, Alexander Spohr wrote:

Jacob,

EOF _does_ fetch any relationship automatic - no matter how you access your EOs relationship.

There must be an error in your EOModel, your EOs or somewhere else.

        atze


Am 04.08.2007 um 21:38 schrieb Jacob Mouka:

Hi List... I'm wondering about EOs' relationships when they are in a displaygroup. Basically on a page the user clicks to select an EO from a displaygroup, and the selected EO iterates over a to- many relationship to summarize some data, but the problem is the array it gets from it's valueForKey method is empty (com.webobjects.eocontrol._EOCheapCopyMutableArray). I know it's a faulting issue because I can bind the relationship to a worepetition just to display it, and it shows up fine. So my question is how can I get webobjects to fetch the array on a call to valueForKey? I think the old way of doing this would be to call willRead, but that doesn't work.

Also, if the same EO is fetched using a plain old fetchspecification it's relationships are intact, so what does a displaygroup do differently?

Jacob
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/atze% 40freeport.de

This email sent to [EMAIL PROTECTED]

Freeport & Soliversum
Alexander Spohr
[EMAIL PROTECTED]
www.freeport.de



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to