Inherits from: NSObject
Package: com.apple.yellow.eoaccess
An EODatabase object represents a single database server. It contains an EOAdaptor which is capable of communicating with the server, a list of EOModels that describe the server's schema, a list of EODatabaseContexts that are connected to the server, and a set of snapshots representing the state of all objects stored in the server.
Each of an EODatabase's EODatabaseContexts forms a separate transaction scope, and is in effect a separate logical user to the server. An EODatabaseContext uses one or more pairs of EODatabaseChannel and EOAdaptorChannel objects to manage data operations (insert, update, delete, and fetch). Adaptors may support a limited number of contexts per database or channels per context, but an application is guaranteed at least one of each.
For more information on the EODatabase class, see the sections:
EODatabase declares the following constants.
Constant | Type | Description |
DistantPastTimeInterval | double |
The lower bound on timestamps. |
GeneralDatabaseException | String | The name of exceptions raised by the database sublayer when errors occur during interactions with a database server. |
- Constructors
- EODatabase
- Adding and removing models
- addModel
- addModelIfCompatible
- removeModel
- models
- Accessing entities
- entityForObject
- entityNamed
- Recording snapshots
- recordSnapshotForGlobalID
- recordSnapshotForSourceGlobalID
- recordSnapshots
- recordToManySnapshots:
- Forgetting snapshots
- forgetSnapshotForGlobalID
- forgetSnapshotsForGlobalIDs
- forgetAllSnapshots
- Accessing snapshots and snapshot timestamps
- snapshotForGlobalID
- snapshotForSourceGlobalID
- snapshots
- timestampForGlobalID
- timestampForSourceGlobalID
- Snapshot reference counting
- incrementSnapshotCountForGlobalID
- decrementSnapshotCountForGlobalID
- disableSnapshotRefcounting
- Registering database contexts
- registerContext
- unregisterContext
- registeredContexts
- Accessing the adaptor
- adaptor
- Managing the database connection
- handleDroppedConnection
- Managing the result cache
- invalidateResultCache
- invalidateResultCacheForEntityNamed
- resultCacheForEntityNamed
- setResultCacheForEntityWithName
public EODatabase(EOAdaptor anAdaptor)
public EODatabase(EOModel aModel)
Typically, you don't need to programmatically create EODatabase objects. Rather, they are created automatically by the control layer. See the class description for more information.
See Also: addModel, adaptor, adaptorName (EOModel)
public static void disableSnapshotRefcounting()
public EOAdaptor adaptor()
See Also: EODatabase constructors
public void addModel(EOModel aModel)
See Also: addModelIfCompatible, models, removeModel
public boolean addModelIfCompatible(EOModel aModel)
See Also: addModel, models, removeModel
public void decrementSnapshotCountForGlobalID(com.apple.yellow.eocontrol.EOGlobalID globalId)
public EOEntity entityForObject(Object anObject)
See Also: entityNamed
public EOEntity entityNamed(String entityName)
See Also: entityForObject
public void forgetAllSnapshots()
ObjectsChangedInStoreNotification
(defined
in the EOControl framework's EOObjectStore class) describing the
invalidated object. For a description of snapshots and their role
in an application, see the class description.See Also: forgetSnapshotForGlobalID, forgetSnapshotsForGlobalIDs, recordSnapshotForGlobalID, recordSnapshots, recordSnapshotForSourceGlobalID, recordToManySnapshots:
public void forgetSnapshotForGlobalID(com.apple.yellow.eocontrol.EOGlobalID globalID)
ObjectsChangedInStoreNotification
(defined
in the EOControl framework's EOObjectStore class) describing the
invalidated object. For a description of snapshots and their role
in an application, see the class description.See Also: forgetSnapshotsForGlobalIDs, forgetAllSnapshots, recordSnapshotForGlobalID
public void forgetSnapshotsForGlobalIDs(NSArray globalIDs)
See Also: forgetSnapshotForGlobalID, forgetAllSnapshots, recordSnapshots
public void handleDroppedConnection()
You should never invoke this method; it's invoked automatically by the Framework.
public void incrementSnapshotCountForGlobalID(com.apple.yellow.eocontrol.EOGlobalID globalID)
public void invalidateResultCache()
See Also: invalidateResultCacheForEntityNamed, resultCacheForEntityNamed
public void invalidateResultCacheForEntityNamed(String entityName)
See Also: invalidateResultCache, resultCacheForEntityNamed
public NSArray models()
See Also: EODatabase constructor, addModel, addModelIfCompatible, removeModel
public void recordSnapshotForGlobalID(
NSDictionary aSnapshot,
com.apple.yellow.eocontrol.EOGlobalID globalID)
See Also: globalIDForRow ( EOEntity), recordSnapshots, forgetSnapshotForGlobalID
public void recordSnapshotForSourceGlobalID(
NSArray globalIDs,
com.apple.yellow.eocontrol.EOGlobalID globalID,
String name)
See Also: recordSnapshotForGlobalID, recordSnapshots, recordSnapshotForGlobalID, snapshotForSourceGlobalID:relationshipName:
public void recordSnapshots(NSDictionary snapshots)
See Also: recordSnapshotForGlobalID, forgetSnapshotsForGlobalIDs
public void recordToManySnapshots(NSDictionary snapshots)
See Also: recordSnapshotForSourceGlobalID, recordSnapshotForGlobalID, snapshotForSourceGlobalID:relationshipName:
public void registerContext(EODatabaseContext aContext)
See Also: unregisterContext, registeredContexts
public NSArray registeredContexts()
See Also: registerContext, unregisterContext
public void removeModel(EOModel aModel)
See Also: addModel, addModelIfCompatible, models
public NSArray resultCacheForEntityNamed(String entityName)
See Also: invalidateResultCache, invalidateResultCacheForEntityNamed
public void setResultCacheForEntityWithName(
NSArray cache,
String entityName)
See Also: invalidateResultCache, invalidateResultCacheForEntityNamed, resultCacheForEntityNamed
public void setTimestampToNow()
public NSDictionary snapshotForGlobalID(
com.apple.yellow.eocontrol.EOGlobalID globalID,
double timestamp)
public NSDictionary snapshotForGlobalID(com.apple.yellow.eocontrol.EOGlobalID globalID)
null
if there
isn't a snapshot for the globalID or if the corresponding timestamp
is less than timestamp. If timestamp isn't provided, DistantPastTimeInterval is
used. For a description of snapshots and their role in an application,
see the class description.See Also: recordSnapshotForGlobalID, forgetSnapshotForGlobalID
public NSArray snapshotForSourceGlobalID(
com.apple.yellow.eocontrol.EOGlobalID globalID,
String name,
double timestamp)
public NSArray snapshotForSourceGlobalID(
com.apple.yellow.eocontrol.EOGlobalID globalID,
String name)
null
if
there isn't a to-many snapshot for globalId or
if the timestamp is less than timestamp. If timestamp isn't provided, DistantPastTimeInterval is
used. For a description of snapshots and their role in an application,
see the class description.public NSDictionary snapshots()
See Also: recordSnapshotForSourceGlobalID, recordToManySnapshots:
public double timestampForGlobalID(com.apple.yellow.eocontrol.EOGlobalID globalId)
EODistantPastTimeInterval
if
there isn't a snapshot.public double timestampForSourceGlobalID(
com.apple.yellow.eocontrol.EOGlobalID globalId,
String relationshipName)
EODistantPastTimeInterval
if
there isn't a snapshot.public void unregisterContext(EODatabaseContext aContext)
See Also: registerContext, registeredContexts