Inherits from: NSObject
Package: com.apple.yellow.eoaccess
An EODatabaseChannel represents an independent communication channel to the database server. It's associated with an EODatabaseContext and an EODatabase, which, together with the EODatabaseChannel, form the database level of Enterprise Objects Framework's access layer. See the EODatabase class specification for more information.
An EODatabaseChannel has an EOAdaptorChannel that it uses to connect to the database server its EODatabase object represents. An EODatabaseChannel fetches database records as instances of enterprise object classes that are specified in its EODatabase's EOModel objects. An EODatabaseChannel also has an EODatabaseContext, which uses the channel to perform fetches and to lock rows in the database. All of the database level objects are used automatically by EOEditingContexts and other components of Enterprise Objects Framework. You rarely need to interact with them directly. In particular, you wouldn't ordinarily use an EODatabaseChannel to fetch objects. Rather, you'd use an EOEditingContext.
- Constructors
- EODatabaseChannel
- Accessing cooperating objects
- adaptorChannel
- databaseContext
- Fetching objects
- selectObjectsWithFetchSpecification
- isFetchInProgress
- fetchObject
- cancelFetch
- Accessing internal fetch state
- setCurrentEntity
- setCurrentEditingContext
- setIsLocking
- isLocking
- setIsRefreshingObjects
- isRefreshingObjects
- Accessing the delegate
- setDelegate
- delegate
public EODatabaseChannel(EODatabaseContext aDatabaseContext)
aDatabaseContext is assigned to the new EODatabaseChannel as the DatabaseContext in which the channel works. The new EODatabaseChannel creates an AdaptorChannel with which to communicate with the database server. The constructor throws an exception if the underlying adaptor context can't create a corresponding adaptor channel.
See Also: databaseContext, adaptorChannel
public EOAdaptorChannel adaptorChannel()
See Also: EODatabaseChannel constructor
public void cancelFetch()
See Also: isFetchInProgress, selectObjectsWithFetchSpecification, fetchObject
public EODatabaseContext databaseContext()
See Also: EODatabaseChannel constructor
public Object delegate()
See Also: setDelegate
public Object fetchObject()
If no snapshot exists for the fetched object, the receiver sends its EODatabase a recordSnapshotForGlobalID message to record one. If a snapshot already exists (because the object was previously fetched), the receiver checks whether it should overwrite the old snapshot with the new one. It does so by asking the delegate with a databaseContextShouldUpdateCurrentSnapshot method. If the delegate doesn't respond to this method, the EODatabaseChannel overwrites the snapshot if it's locking or refreshing fetched objects. Further, if the EODatabaseChannel is refreshing fetched objects, it posts an ObjectsChangedInStoreNotification on behalf of its EODatabaseContext (which causes any EOEditingContext using that EODatabaseContext to update its enterprise object with the values recorded in the new snapshot).
For information on locking and update strategies, see the EODatabaseContext class specification. For information on refreshing fetched objects, see the EOFetchSpecification class specification.
Ordinarily, you don't directly use an EODatabaseChannel to fetch objects. Rather, you use an EOEditingContext, which uses an underlying EODatabaseChannel to do its work.
See Also: cancelFetch, isFetchInProgress, isLocking, isRefreshingObjects
public boolean isLocking()
See Also: locksObjects (EOFetchSpecification)
public boolean isRefreshingObjects()
See Also: refreshesRefetchedObjects (EOFetchSpecification), fetchObject
public void selectObjectsWithFetchSpecification(
com.apple.yellow.eocontrol.EOFetchSpecification fetchSpecification,
com.apple.yellow.eocontrol.EOEditingContext anEditingContext)
Throws an exception if an error occurs; the particular exception depends on the specific error, and is indicated in the exception's description. Some possible reasons for failure are:
This method invokes the delegate methods databaseContextShouldSelectObjects, databaseContextShouldUsePessimisticLock, and databaseContextDidSelectObjects. See their descriptions in the EODatabaseContext class specification for more information.
You wouldn't ordinarily invoke this method directly; rather, you'd use an EOEditingContext to select and fetch enterprise objects.
See Also: fetchObject
public void setCurrentEditingContext(com.apple.yellow.eocontrol.EOEditingContext anEditingContext)
See Also: setCurrentEntity
public void setCurrentEntity(EOEntity anEntity)
See Also: setCurrentEditingContext
public void setDelegate(Object anObject)
See Also: delegate
public void setIsLocking(boolean flag)
An EODatabaseChannel automatically sets this flag according to the fetch specification used in a selectObjectsWithFetchSpecification message. You might invoke this method directly if evaluating SQL directly with EOAdaptorChannel's evaluateExpression method.
See Also: locksObjects (EOFetchSpecification)
public void setIsRefreshingObjects(boolean flag)
An EODatabaseChannel automatically sets this flag according to the fetch specification used in a selectObjectsWithFetchSpecification message. You might invoke this method directly if evaluating SQL directly with EOAdaptorChannel's evaluateExpression: method.
See Also: refreshesRefetchedObjects (EOFetchSpecification)