Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

< Previous PageNext Page > Hide TOC

Fetching and Accessing Data

The methods in this section fetch data from a data source and access the properties of enterprise object instances.

EOFetchSpecification constructor: (StringentityName, EOQualifierqualifier, NSArraysortOrderings)

Use this method to construct a fetch specification that you use to retrieve data from a data source. Only the entityName parameter is mandatory. A fetch specification is transformed by the framework into a SQL expression in which entityName is used in the FROM clause, qualifier is used in the WHERE clause, and sortOrderings is used in the ORDER BY clause.

EOUtilities: objectsForEntityNamed(EOEditingContexteditingContext, StringentityName)

This convenience method fetches all the enterprise objects for the entity specified by entityName.

EOEditingContext: objectsWithFetchSpecification(EOFetchSpecificationfs)

Use this method to retrieve data from a data source.

EOUtilities: primaryKeyForObject(EOEditingContexteditingContext, EOEnterpriseObjectenterpriseObject)

This convenience method retrieves the primary key for the enterprise object specified by enterpriseObject. You usually do not need to worry about primary keys when building an Enterprise Objects application.

EOQualifier: qualifierWithQualifierFormat(Stringformat, NSArrayarguments)

Use this method to construct a qualifier for use in a fetch specification or for use when sorting fetch results in memory.

EOUtilities: rawRowsForSQL(EOEditingContexteditingContext, StringmodelName, StringsqlString)

This convenience method evaluates the specified sqlString and uses information from the EOModel specified by modelName to retrieve the raw database rows specified by sqlString. In an Enterprise Objects application, you usually do not need to explicitly think about SQL or fetch raw rows.

EOCustomObject: valueForKey(Stringkey)

This method returns an object for the property in an enterprise object specified by key. This method is part of the key-value coding infrastructure of Enterprise Objects, in which an object’s properties are accessed by key rather than directly as fields or through accessor methods. This is discussed in more detail in “Accessing an Enterprise Object’s Data.”

EOCustomObject: valueForKeyPath(StringkeyPath)

This method returns an object for the property in an enterprise object’s relationship specified by keyPath, where keyPath is a String of the form “relationship.property”. This method allows you to access relationships between enterprise objects using a chain of keys. It is part of the key-value coding infrastructure of Enterprise Objects, which is discussed in more detail in “Accessing an Enterprise Object’s Data.”



< Previous PageNext Page > Hide TOC


Last updated: 2007-07-11




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice