PATH |
EODataSource
Inherits from: Object
Package: com.webobjects.eocontrol
Class Description
EODataSource is an abstract class that defines a basic API for providing enterprise objects. It exists primarily as a simple means for a display group (EODisplayGroup from EOInterface or WODisplayGroup from WebObjects) or other higher-level class to access a store of objects. EODataSource defines functional implementations of very few methods; concrete subclasses, such as EODatabaseDataSource (defined in EOAccess) and EODetailDataSource, define working data sources by implementing the others. EODatabaseDataSource, for example, provides objects fetched through an EOEditingContext, while EODetailDataSource provides objects from a relationship property of a master object. For information on creating your own EODataSource subclass, see the section "Creating a Subclass" (page 63).
An EODataSource provides its objects with its fetchObjects method. insertObject and deleteObject add and remove individual objects, and createObject instantiates a new object. Other methods provide information about the objects, as described below.
Method Types
Accessing the objects
fetchObjectsInserting and deleting objects
createObjectinsertObjectdeleteObjectCreating detail data sources
dataSourceQualifiedByKeyqualifyWithRelationshipKeyAccessing the editing context
editingContextAccessing the class description
classDescriptionForObjects
Constructors
EODataSource
public EODataSource()
Description forthcoming.
Instance Methods
classDescriptionForObjects
public EOClassDescription classDescriptionForObjects()
Implemented by subclasses to return an EOClassDescription that provides information about the objects provided by the receiver. EODataSource's implementation returns null
.
createObject
public Object createObject()
Creates a new object, inserts it in the receiver's collection of objects if appropriate, and returns the object. Returns null
if the receiver can't create the object or can't insert it. You should invoke insertObject after this method to actually add the new object to the receiver.
As a convenience, EODataSource's implementation sends the receiver's EOClassDescription a createInstanceWithEditingContext message to create the object. If this succeeds and the receiver has an EOEditingContext, it sends the EOEditingContext an insertObject message to register the new object with the EOEditingContext (note that this does not insert the object into the EODataSource). Subclasses that don't use EOClassDescriptions or EOEditingContexts should override this method without invoking super's implementation.
See Also: classDescriptionForObjects, editingContext
dataSourceQualifiedByKey
public abstract EODataSource dataSourceQualifiedByKey(String relationshipKey)
Implemented by subclasses to return a detail EODataSource that provides the destination objects of the relationship named by relationshipKey. The detail EODataSource can be qualified using qualifyWithRelationshipKey to set a specific master object (or to change the relationship key). EODataSource's implementation merely throws an exception; subclasses shouldn't invoke super's implementation.
deleteObject
public abstract void deleteObject(Object anObject)
Implemented by subclasses to delete anObject. EODataSource's implementation merely throws an exception; subclasses shouldn't invoke super's implementation.
editingContext
public EOEditingContext editingContext()
Implemented by subclasses to return the receiver's EOEditingContext. EODataSource's implementation returns null
.
fetchObjects
public NSArray fetchObjects()
Implemented by subclasses to fetch and return the objects provided by the receiver. EODataSource's implementation returns null
.
insertObject
public abstract void insertObject(Object object)
Implemented by subclasses to insert object. EODataSource's implementation merely throws an exception; subclasses shouldn't invoke super's implementation.
qualifyWithRelationshipKey
public abstract void qualifyWithRelationshipKey( String key, Object sourceObject)
Implemented by subclasses to qualify the receiver, a detail EODataSource, to display destination objects for the relationship named key belonging to sourceObject. key should be the same as the key specified in the dataSourceQualifiedByKey message that created the receiver. If sourceObject is null
, the receiver qualifies itself to provide no objects. EODataSource's implementation merely throws an exception; subclasses shouldn't invoke super's implementation.
© 2001 Apple Computer, Inc. (Last Published April 19, 2001)