- Inherits from:
- NSObject
- Conforms to:
- NSObject
- (NSObject)
Declared in:
- EOControl/EODataSource.h
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" .
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.
- Accessing the objects
- - fetchObjects
- Inserting and deleting objects
- - createObject
- - insertObject:
- - deleteObject:
- Creating detail data sources
- - dataSourceQualifiedByKey:
- - qualifyWithRelationshipKey:ofObject:
- Accessing the editing context
- - editingContext
- Accessing the class description
- - classDescriptionForObjects
- (EOClassDescription *)classDescriptionForObjects
- (id)createObject
As a convenience, EODataSource's implementation sends the receiver's EOClassDescription a createInstanceWithEditingContext:globalID:zone: 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
- (EODataSource *)dataSourceQualifiedByKey:(NSString
*)relationshipKey
- (void)deleteObject:(id)anObject
- (EOEditingContext *)editingContext
- (NSArray *)fetchObjects
- (void)insertObject:(id)object
- (void)qualifyWithRelationshipKey:(NSString
*)key
ofObject:(id)sourceObject