WebObjects 5.2.3

com.webobjects.eodistribution.client
Class EODistributedClassDescription

java.lang.Object
  extended bycom.webobjects.eocontrol.EOClassDescription
      extended bycom.webobjects.eodistribution.client.EODistributedClassDescription
All Implemented Interfaces:
NSCoding, Serializable

public class EODistributedClassDescription
extends EOClassDescription
implements NSCoding

EODistributedClassDescription is the Java Client equivalent to EOClassDescription. It contains object-level information about this class of enterprise objects, mainly the list of attributes and relationships.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class com.webobjects.eocontrol.EOClassDescription
EOClassDescription.ClassDelegate
 
Nested classes inherited from class com.webobjects.foundation.NSCoding
NSCoding.Support
 
Field Summary
 
Fields inherited from class com.webobjects.eocontrol.EOClassDescription
ClassDescriptionNeededForClassNotification, ClassDescriptionNeededForEntityNameNotification, DeleteRuleCascade, DeleteRuleDeny, DeleteRuleNoAction, DeleteRuleNullify
 
Constructor Summary
EODistributedClassDescription(Class theClass)
          The constructor for EODistributedClassDescription, usually called internally.
EODistributedClassDescription(String name, Class theClass)
          A constructor for EODistributedClassDescription, usually called internally.
 
Method Summary
 NSArray attributeKeys()
          Returns an array of keys for attributes of the receiver's enterprise objects.
 EOAttribute attributeNamed(String key)
          Returns the EOAttribute of the given name (key).
 void awakeObjectFromFetch(EOEnterpriseObject eo, EOEditingContext ec)
          Called every time an object is fetched in an editing context.
 void awakeObjectFromInsertion(EOEnterpriseObject target, EOEditingContext ec)
          Automatically creates related objects for relationships which propagate primary keys.
 EOClassDescription classDescriptionForDestinationKey(String detailKey)
          Returns the class description for objects at the destination of the given relationship.
 Class classForCoder()
          Returns the class that will be used by NSCoders to later re-create this object.
 EOEnterpriseObject createInstanceWithEditingContext(EOEditingContext ec, EOGlobalID gid)
          Creates an enterprise object of the appropriate class.
static Object decodeObject(NSCoder coder)
          Decodes (re-creates) an EODistributedClassDescription from the stored definitions in the coder.
 Format defaultFormatterForKey(String key)
          Returns a default formatter for the attribute key, based on the value class of the attribute.
 int deleteRuleForRelationshipKey(String relationshipKey)
          Returns the delete rule as defined in EOClassDescription, for the specified relationship.
 void encodeWithCoder(NSCoder coder)
          Encodes (stores) the defining values of this EODistributedClassDescription object into the given coder.
 String entityName()
          Returns the name for this class description.
 String inverseForRelationshipKey(String relationshipKey)
          Returns the name of the relationship pointing back at the receiver from the destination of the given relationship.
 boolean ownsDestinationObjectsForRelationshipKey(String relationshipKey)
          Returns whether or not the objects in the destination of the given relationship should be deleted if they are removed from the relationship (and not added to the corresponding relationship of another object).
 EORelationship relationshipNamed(String key)
          Returns the EORelationship of the given name (key).
 boolean shouldRecordCodingReferences()
          Returns whether coding references should be recorded.
 NSArray toManyRelationshipKeys()
          Returns an array of keys for to-many relationship properties of the receiver's enterprise objects.
 NSArray toOneRelationshipKeys()
          Returns an array of keys for to-one relationship properties of the receiver's enterprise objects.
 Object validateValueForKey(Object value, String key)
          Validate the value passed and return a possibly coerced value.
 
Methods inherited from class com.webobjects.eocontrol.EOClassDescription
classDelegate, classDescriptionForClass, classDescriptionForEntityName, classDescriptionForKeyPath, classForAttributeKey, clientAttributeKeys, clientToManyRelationshipKeys, clientToOneRelationshipKeys, defaultFormatterForKeyPath, displayNameForKey, fetchSpecificationNamed, finalize, invalidateClassDescriptionCache, propagateDeleteForObject, registerClassDescription, setClassDelegate, superClassDescription, toString, userPresentableDescriptionForObject, validateObjectForDelete, validateObjectForSave
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EODistributedClassDescription

public EODistributedClassDescription(Class theClass)
The constructor for EODistributedClassDescription, usually called internally.

Parameters:
theClass - the Class of the enterprise objects for this entity

EODistributedClassDescription

public EODistributedClassDescription(String name,
                                     Class theClass)
A constructor for EODistributedClassDescription, usually called internally.

Parameters:
name - this parameter is ignored
theClass - the Class of the enterprise objects for this entity
Method Detail

attributeKeys

public NSArray attributeKeys()
Returns an array of keys for attributes of the receiver's enterprise objects. Attributes contain data (Numbers, Strings, etc.) rather than pointers to other enterprise objects.

Overrides:
attributeKeys in class EOClassDescription
Returns:
the array of attribute names
See Also:
EOClassDescription.entityName(), EOClassDescription.toOneRelationshipKeys(), EOClassDescription.toManyRelationshipKeys()

attributeNamed

public EOAttribute attributeNamed(String key)
Returns the EOAttribute of the given name (key).

Parameters:
key - the name of the attribute
Returns:
the EOAttribute for the given key (name)

awakeObjectFromFetch

public void awakeObjectFromFetch(EOEnterpriseObject eo,
                                 EOEditingContext ec)
Called every time an object is fetched in an editing context.

Overrides:
awakeObjectFromFetch in class EOClassDescription
Parameters:
eo - the object to be 'awakened'
ec - the editing context in which the object will be awakened

awakeObjectFromInsertion

public void awakeObjectFromInsertion(EOEnterpriseObject target,
                                     EOEditingContext ec)
Automatically creates related objects for relationships which propagate primary keys. Can be overridden for example to supply default values to new enterprise objects.

Overrides:
awakeObjectFromInsertion in class EOClassDescription
Parameters:
target - the object to be 'awakened'
ec - the editing context in which the object will be awakened

classDescriptionForDestinationKey

public EOClassDescription classDescriptionForDestinationKey(String detailKey)
Returns the class description for objects at the destination of the given relationship. For example, project.classDescriptionForDestinationKey("leader") might return the class description for the Employee class.

Overrides:
classDescriptionForDestinationKey in class EOClassDescription
Parameters:
detailKey - the name of the relationship for whose destination entity one wants to find the class description
Returns:
the class description for detailKey

classForCoder

public Class classForCoder()
Returns the class that will be used by NSCoders to later re-create this object.

Specified by:
classForCoder in interface NSCoding
Returns:
the class that will be used by NSCoders to later re-create this object

createInstanceWithEditingContext

public EOEnterpriseObject createInstanceWithEditingContext(EOEditingContext ec,
                                                           EOGlobalID gid)
Creates an enterprise object of the appropriate class.

Overrides:
createInstanceWithEditingContext in class EOClassDescription
Parameters:
ec - the editing context the new object will live in
gid - the gid for the new object
Returns:
the newly created enterprise object

decodeObject

public static Object decodeObject(NSCoder coder)
Decodes (re-creates) an EODistributedClassDescription from the stored definitions in the coder.

Parameters:
coder - the NSCoder supplying the definitions
Returns:
the re-created (decoded) EODistributedClassDescription

defaultFormatterForKey

public Format defaultFormatterForKey(String key)
Returns a default formatter for the attribute key, based on the value class of the attribute.

Overrides:
defaultFormatterForKey in class EOClassDescription
Parameters:
key - the editing context in which the object will be awakened
Returns:
the default formatter, or possibly null

deleteRuleForRelationshipKey

public int deleteRuleForRelationshipKey(String relationshipKey)
Returns the delete rule as defined in EOClassDescription, for the specified relationship. The constants EOClassDescription (in com.webobjects.eocontrol) defines are DeleteRuleNullify, DeleteRuleCascade, DeleteRuleDeny and DeleteRuleNoAction.

Overrides:
deleteRuleForRelationshipKey in class EOClassDescription
Parameters:
relationshipKey - The name of the relationship
Returns:
The name of the inverse relationship or null
See Also:
EOClassDescription

encodeWithCoder

public void encodeWithCoder(NSCoder coder)
Encodes (stores) the defining values of this EODistributedClassDescription object into the given coder.

Specified by:
encodeWithCoder in interface NSCoding
Parameters:
coder - the NSCoder used to store the defining values
See Also:
NSCoder

entityName

public String entityName()
Returns the name for this class description. Must be unique.

Overrides:
entityName in class EOClassDescription
Returns:
the entity name
See Also:
EOClassDescription.attributeKeys(), EOClassDescription.toOneRelationshipKeys(), EOClassDescription.toManyRelationshipKeys()

inverseForRelationshipKey

public String inverseForRelationshipKey(String relationshipKey)
Returns the name of the relationship pointing back at the receiver from the destination of the given relationship. For example, employee.inverseForRelationshipKey(eo, "department") might return "employees" (such that this employee would appear in employee->department->employees). Might return null.

Overrides:
inverseForRelationshipKey in class EOClassDescription
Parameters:
relationshipKey - the name of the original relationship
Returns:
the name of the inverse relationship or null

ownsDestinationObjectsForRelationshipKey

public boolean ownsDestinationObjectsForRelationshipKey(String relationshipKey)
Returns whether or not the objects in the destination of the given relationship should be deleted if they are removed from the relationship (and not added to the corresponding relationship of another object). For example, if a LineItem is removed from an Invoice, it should be deleted.

Overrides:
ownsDestinationObjectsForRelationshipKey in class EOClassDescription
Parameters:
relationshipKey - the relationship's name
Returns:
true if the specified relationship owns the destination objects; falseotherwise

relationshipNamed

public EORelationship relationshipNamed(String key)
Returns the EORelationship of the given name (key).

Parameters:
key - the name of the relationship
Returns:
the EORelationship for the given key (name)

shouldRecordCodingReferences

public boolean shouldRecordCodingReferences()
Returns whether coding references should be recorded. For this class, always true. This method is part of an internally used interface.

Returns:
true if coding references should be recorded (For this class, always returns true).

toManyRelationshipKeys

public NSArray toManyRelationshipKeys()
Returns an array of keys for to-many relationship properties of the receiver's enterprise objects.

Overrides:
toManyRelationshipKeys in class EOClassDescription
Returns:
the array of to-many relationship names
See Also:
EOClassDescription.entityName(), EOClassDescription.toOneRelationshipKeys(), EOClassDescription.attributeKeys()

toOneRelationshipKeys

public NSArray toOneRelationshipKeys()
Returns an array of keys for to-one relationship properties of the receiver's enterprise objects.

Overrides:
toOneRelationshipKeys in class EOClassDescription
Returns:
the array of to-one relationship names
See Also:
EOClassDescription.entityName(), EOClassDescription.attributeKeys(), EOClassDescription.toManyRelationshipKeys()

validateValueForKey

public Object validateValueForKey(Object value,
                                  String key)
                           throws NSValidation.ValidationException
Validate the value passed and return a possibly coerced value. Throws a validation exception if it cannot coerce the value.

Overrides:
validateValueForKey in class EOClassDescription
Parameters:
value - the value to be checked for being valid
key - the name of the attribute (or relationship) to which the value might leter be assigned
Returns:
the (possibly converted) value
Throws:
NSValidation.ValidationException
See Also:
EOValidation

Last updated Thu Oct 21 15:04:16 PDT 2004.

Copyright © 2004 Apple Computer, Inc.