• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: longRespose Query
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >longRespose Query (From: "Jonathan Fleming" <email@hidden>)

  • Prev by Date: Re: WORepitition - Flaging a single row
  • Next by Date: Re: Can Webobjects Do This..
  • Previous by thread: longRespose Query
  • Next by thread: creating a qualifier in EOModeler with like and a variable
  • Index(es):
    • Date
    • Thread