Implemented by:
- EOCustomObject
- EOGenericRecord
- Implements:
- EODeferredFaulting
- EOKeyValueCodingAdditions
- EOKeyValueCoding.KeyBindingCreation
- EORelationshipManipulation
- EOValidation
- EOFaulting (EODeferredFaulting)
- EOKeyValueCoding (EOKeyValueCodingAdditions)
- Package:
- com.apple.client.eocontrol
- com.apple.yellow.eocontrol
The EOEnterpriseObject interface identifies basic enterprise object behavior, defining methods for supporting operations common to all enterprise objects. Among these are methods for initializing instances, announcing changes, setting and retrieving property values, and performing validation of state. Some of these methods are for enterprise objects to implement or override, and some are meant to be used as defined by the Framework. Many methods are used internally by the Framework and rarely invoked by application code.
Many of the functional areas are defined in smaller, more specialized interfaces and incorporated in the over arching EOEnterpriseObject interface:
The remaining methods are introduced in the EOEnterpriseObject interface itself and can be broken down into three functional groups discussed in the following sections:
You rarely need to implement the EOEnterpriseObject interface from scratch. The Framework provides default implementations of the methods in EOCustomObject and EOGenericRecord. Use EOGenericRecords to represent enterprise objects that don't require custom behavior, and create subclasses of EOCustomObject to represent enterprise objects that do. The section "Writing an Enterprise Object Class" highlights the methods that you typically provide or override in a custom enterprise object class.
EOKeyValueCoding
- handleQueryWithUnboundKey
- handleTakeValueForUnboundKey
- storedValueForKey
- takeStoredValueForKey
- takeValueForKey
- unableToSetNullForKey
- valueForKey
EOKeyValueCodingAdditions
- takeValueForKeyPath
- takeValuesFromDictionary
- valueForKeyPath
- valuesForKeys
EORelationshipManipulation
- addObjectToBothSidesOfRelationshipWithKey
- addObjectToPropertyWithKey
- removeObjectFromBothSidesOfRelationshipWithKey
- removeObjectFromPropertyWithKey
EOValidation
- validateForDelete
- validateForInsert
- validateForSave
- validateForUpdate
- validateValueForKey
EOFaulting
- clearFault
- faultHandler
- isFault
- turnIntoFault
- willRead
- Initializing enterprise objects
- awakeFromFetch
- awakeFromInsertion
- Announcing changes
- willChange
- Getting an object's EOEditingContext
- editingContext
- Getting class description information
- allPropertyKeys
- attributeKeys
- classDescription
- classDescriptionForDestinationKey
- deleteRuleForRelationshipKey
- entityName
- inverseForRelationshipKey
- isToManyKey
- ownsDestinationObjectsForRelationshipKey
- toManyRelationshipKeys
- toOneRelationshipKeys
- Modifying relationships
- propagateDeleteWithEditingContext
- clearProperties
- Working with snapshots
- snapshot
- updateFromSnapshot
- Merging values
- changesFromSnapshot
- reapplyChangesFromDictionary
- Invoking behavior on the server (com.apple.client.eocontrol only)
- invokeRemoteMethod
- Getting descriptions
- eoDescription
- eoShallowDescription
- userPresentableDescription
public abstract NSArray
allPropertyKeys
()
public abstract NSArray
attributeKeys
()
See Also: toOneRelationshipKeys, toManyRelationshipKeys
public abstract void
awakeFromFetch
(EOEditingContext anEditingContext)
super
's implementation
before performing their own initialization.public abstract void
awakeFromInsertion
(EOEditingContext anEditingContext)
super
's
implementation before performing their own initialization.public abstract NSDictionary
changesFromSnapshot
(NSDictionary snapshot)
Returns a dictionary whose keys correspond to the receiver's properties with uncommitted changes relative to snapshot, and whose values are the uncommitted values. In both snapshot and the returned dictionary, where a key represents a to-many relationship, the corresponding value is an NSArray containing two other NSArrays: the first is an array of objects to be added to the relationship property, and the second is an array of objects to be removed.
See Also: reapplyChangesFromDictionary
public abstract EOClassDescription
classDescription
()
public abstract EOClassDescription
classDescriptionForDestinationKey
(String key)
public abstract void
clearProperties
()
public abstract int
deleteRuleForRelationshipKey
(String relationshipKey)
For example, an Invoice object might return DeleteRuleNullify
for
the relationship named "lineItems", since when an invoice is
deleted, its line items should be deleted as well. For more information
on the delete rules, see the method description for EOClassDescription's deleteRuleForRelationshipKey in
the class specification for EOClassDescription, the class in which
they're defined.
EOCustomObject's implementation of this method simply sends a deleteRuleForRelationshipKey message to the receiver's EOClassDescription.
See Also: propagateDeleteWithEditingContext, validateForDelete (EOValidation)
public abstract EOEditingContext
editingContext
()
public abstract String
entityName
()
public abstract String
eoDescription
()
This method is useful for debugging. You can implement a toString
method
that invokes this one, and the debugger's print-object command
(po
on the command line) automatically
displays this description. You can also invoke this method directly
on the command line of the debugger.
See Also: userPresentableDescription
public abstract String
eoShallowDescription
()
eoDescription
invokes
this method for relationship destinations to avoid infinite recursion
through cyclical relationships. EOCustomObject's implementation
simply returns a string containing the receiver's class and entity
names
.
See Also: userPresentableDescription
public abstract String
inverseForRelationshipKey
(String relationshipKey)
You might override this method for reciprocal relationships that aren't defined using the same join attributes. For example, if a Member object has a relationship to CreditCard based on the card number, but a CreditCard has a relationship to Member based on the Member's primary key, both classes need to override this method. This is how Member might implement it:
public String inverseForRelationshipKey(String relationshipKey) { if (relationshipKey.equals("creditCard")) return "member"; else return super.inverseForRelationshipKey(relationshipKey); }
public abstract Object
invokeRemoteMethod
(
String methodName,
Object[] arguments)
(com.apple.client.eocontrol only) Invokes methodName using arguments. To pass an enterprise object as an argument, use its global ID. This method has the side effect of saving all the changes from the receiver's editing context all the way down to the editing context in the server session.
public abstract boolean
isToManyKey
(String key)
public abstract boolean
ownsDestinationObjectsForRelationshipKey
(String key)
See Also:
deleteRuleForRelationshipKey, ownsDestination
(EOAccess'
EORelationship)
public abstract void
propagateDeleteWithEditingContext
(EOEditingContext anEditingContext)
See Also: deleteRuleForRelationshipKey
public abstract void
reapplyChangesFromDictionary
(NSDictionary changes)
Similar to takeValuesFromDictionary, but the changes dictionary can contain arrays for to-many relationships. Where a key represents a to-many relationship, the dictionary's value is an NSArray containing two other NSArrays: the first is an array of objects to be added to the relationship property, and the second is an array of objects to be removed. EOCustomObject's implementation should be sufficient for all purposes; you shouldn't have to override this method.
See Also: changesFromSnapshot
public abstract NSDictionary
snapshot
()
See Also: updateFromSnapshot
public abstract NSArray
toManyRelationshipKeys
()
See Also: attributeKeys, toOneRelationshipKeys
public abstract NSArray
toOneRelationshipKeys
()
See Also: attributeKeys, toManyRelationshipKeys
public abstract void
updateFromSnapshot
(NSDictionary aSnapshot)
See Also: snapshot
public abstract String
userPresentableDescription
()
Returns a short (no longer than 60 characters) description of an enterprise object based on its data. EOCustomObject's implementation enumerates the object's attributeKeys and returns the values of all of its properties, separated by commas (applying the default formatter for numbers and dates).
See Also: eoDescription, eoShallowDescription
public abstract void
willChange
()
public void setRoleName(String value) { willChange(); roleName = value; }
In com.apple.client.eocontrol, this method invokes willRead.