• 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: Is there any get column method?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is there any get column method?


  • Subject: Re: Is there any get column method?
  • From: Kevin Xiaowen Ren <email@hidden>
  • Date: Wed, 14 Jul 2004 12:23:42 +1200

rawRowSpec.setRawRowKeyPaths(attributesToFetch);

it's returning an array of dictionaries not only the values.

kevin


At 19:34 13/07/2004 -0400, you wrote:
Hi Kevin,

When you use a regular fetch specification, EOF fetches the whole row because it will instantiate a new enterprise object for that row. Obviously, when you're working with objects, it doesn't make sense to only have a subset of its values available, so that's why it all columns are returned from the fetch. When you're dealing with EOF, it's best to think in terms of objects and attributes, not tables and columns.

However, for those cases where you really just need a subset of the data and want to fetch a single column rather than the whole row, you'll need to fetch raw rows. Try something like this:

EOFetchSpecification rawRowSpec = new EOFetchSpecification(myQual, null, null);
rawRowSpec.setFetchesRawRows(true);
NSArray attributesToFetch = new NSArray("myAttributeKeyName");
rawRowSpec.setRawRowKeyPaths(attributesToFetch);


This fetch specification will return you an array of NSDictionaries containing only the column(s) you specified in setRawRowKeyPaths().

I hope that helps,

Colin

On Tuesday, July 13, 2004, at 06:53 PM, Kevin Xiaowen Ren wrote:

Hi,

When I use EOQualifier, it's always return the whole raw from table.
Is there any API to get column from table?

Thanks,

kevin
_______________________________________________
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.


---
Colin Clark
Dynamic Web and Database Development Lead,
Resource Centre for Academic Technology,
University of Toronto


Kevin Xiaowen Ren Programmer Black Albatross 64-3- 479 5468 www.blackalbatross.com _______________________________________________ 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.


  • Follow-Ups:
    • Re: Is there any get column method?
      • From: Art Isbell <email@hidden>
References: 
 >Is there any get column method? (From: Kevin Xiaowen Ren <email@hidden>)
 >Re: Is there any get column method? (From: Colin Clark <email@hidden>)

  • Prev by Date: Re: Is there any get column method?
  • Next by Date: Re: Using mod_rewrite
  • Previous by thread: Re: Is there any get column method?
  • Next by thread: Re: Is there any get column method?
  • Index(es):
    • Date
    • Thread