Re: longRespose Query
Re: longRespose Query
- Subject: Re: longRespose Query
- From: Jonathan Rochkind <email@hidden>
- Date: Mon, 25 Aug 2003 10:46:45 -0500
It is possible to do a count of EO's before they are fetched from the
db. But I think you are going to run into several other problems with your
idea. But in answer to your question, here's how I do it. It requires an
extra round trip to the db, but it's simple.
Add an attribute to the entity you will be fetching. Call it for example
"_derivedObjectCount". It is NOT a class property. It's internal type is
Numeric. It's a derived column, defined as "count(*)".
Now, when you've got your fetch specification, before you use it, tell it:
setRawRowKeyPaths( new NSArray("_derivedObjectCount") );
fetch the specification. It won't return EOs, it won't return raw rows, all
it will return is an NSArray consisting of a single NSDictionary,
consisting of a single key/value, the value is your count.
Now, setRawRowKeyPaths( null ), and you can fetch the specification again
in the normal way.
Hope this helps,
--Jonathan
At 01:30 AM 8/22/2003 +0100, Jonathan Fleming wrote:
Is it possible to do a count of eo's before they are fetched from the
database? Basically I want to use the total number of rows in a table that
is being fetched as myStop value iVar bound to the maxValue attribute of a
WOCompletion bar on a longResponsePage.
If so how?
I don't think I'm talking out of my head am I?
Regards
Jonathan :^)
_________________________________________________________________
On the move? Get Hotmail on your mobile phone http://www.msn.co.uk/msnmobile
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.