PATH |
Inherits from: EODataSource
Implements: EOKeyValueArchiving Serializable
Package: com.webobjects.eocontrol
EODetailDataSource defines a data source for use in master-detail configurations, where operations in the detail data source are applied directly to properties of a master object. EODetailDataSource implements the standard fetchObjects, insertObject, and deleteObject methods to operate on a relationship property of its master object, so it works for any concrete subclass of EODataSource, including another EODetailDataSource (for a chain of three master and detail data sources).
To set up an EODetailDataSource programmatically, you typically create it by sending a dataSourceQualifiedByKey message to the master data source, then establish the master object with a qualifyWithRelationshipKey message. The latter method records the name of a relationship for a particular object to resolve in fetchObjects and to modify in insertObject, and deleteObject. These three methods then manipulate the relationship property of the master object to perform the operations requested. See the individual method descriptions for more information.
Constructors EODetailDataSource Qualifying instances qualifyWithRelationshipKey Examining instances masterDataSource detailKey masterObject Accessing the master class description masterClassDescription setMasterClassDescription Accessing the objects fetchObjects Inserting and deleting objects insertObject deleteObject Accessing the master editing context editingContext
public EODetailDataSource( EOClassDescription masterClassDescription, String relationshipKey)
Creates and returns a new EODetailDataSource object. The new data source's masterObject is associated with masterClassDescription, and relationshipKey is assigned to the new data source's detailKey. The constructor invokes qualifyWithRelationshipKey specifying relationshipKey as the relationship key and null as the object.
See Also: masterClassDescription
public EODetailDataSource( EODataSource masterDataSource, String relationshipKey)
Creates and returns a new EODetailDataSource object. The new data source provides destination objects for the relationship named by relationshipKey from a masterObject in masterDataSource.
See Also: masterDataSource
public static Object decodeWithKeyValueUnarchiver(EOKeyValueUnarchiver unarchiver)
public EOClassDescription classDescriptionForObjects()
public EODataSource dataSourceQualifiedByKey(String aKey)
public void deleteObject(Object anObject)
public String detailKey()
null
.
public EOEditingContext editingContext()
null
if there isn't one.
public void encodeWithKeyValueUnarchiver(EOKeyValueUnarchiver unarchiver)
public NSArray fetchObjects()
public void insertObject(Object anObject)
public EOClassDescription masterClassDescription()
See Also: setMasterClassDescription, EODetailDataSource constructor
public EODataSource masterDataSource()
See Also: detailKey, EODetailDataSource constructor
public Object masterObject()
See Also: detailKey
public void qualifyWithRelationshipKey( String relationshipKey, Object masterObject)
null
, this method causes the receiver to return an empty array when sent a fetchObjects message.
See Also: detailKey
public void setDetailKey(String detailKey)
public void setMasterClassDescription(EOClassDescription classDescription)
See Also: masterClassDescription
© 2001 Apple Computer, Inc. (Last Published April 19, 2001)