PATH |
EODetailDataSource
Inherits from: EODataSource
Implements: EOKeyValueArchiving Serializable
Package: com.webobjects.eocontrol
Class Description
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.
Method Types
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
Constructors
EODetailDataSource
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
Static Methods
decodeWithKeyValueUnarchiver
public static Object decodeWithKeyValueUnarchiver(EOKeyValueUnarchiver unarchiver)
Instance Methods
classDescriptionForObjects
public EOClassDescription classDescriptionForObjects()
dataSourceQualifierByKey
public EODataSource dataSourceQualifiedByKey(String aKey)
deleteObject
public void deleteObject(Object anObject)
detailKey
public String detailKey()
null
.
editingContext
public EOEditingContext editingContext()
null
if there isn't one.
encodeWithKeyValueUnarchiver
public void encodeWithKeyValueUnarchiver(EOKeyValueUnarchiver unarchiver)
fetchObjects
public NSArray fetchObjects()
insertObject
public void insertObject(Object anObject)
masterClassDescription
public EOClassDescription masterClassDescription()
See Also: setMasterClassDescription, EODetailDataSource constructor
masterDataSource
public EODataSource masterDataSource()
See Also: detailKey, EODetailDataSource constructor
masterObject
public Object masterObject()
See Also: detailKey
qualifyWithRelationshipKey
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
setDetailKey
public void setDetailKey(String detailKey)
setMasterClassDescription
public void setMasterClassDescription(EOClassDescription classDescription)
See Also: masterClassDescription
© 2001 Apple Computer, Inc. (Last Published April 19, 2001)