Re: Is there any get column method?
Re: Is there any get column method?
- Subject: Re: Is there any get column method?
- From: Colin Clark <email@hidden>
- Date: Tue, 13 Jul 2004 19:34:55 -0400
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
_______________________________________________
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.