Package Modeling :: Module EntityClassDescription :: Class EntityClassDescription
[show private | hide private]
[frames | no frames]

Type EntityClassDescription

      object --+    
               |    
ClassDescription --+
                   |
                  EntityClassDescription


Documentation forthcoming

'EntityClassDescription' is a concrete subclass of 'ClassDescription' which uses an Entity to service the messages it responds to.


Method Summary
  __init__(self, anEntity)
Initializes a classe description with the supplied entity.
  adaptorName(self)
Returns the name of the adaptor (like: 'Postgres') which is used to make persistent the corresponding instances
  allAttributesKeys(self)
Returned the set of Attributes defined by the underlying Entity.
  allToManyRelationshipKeys(self)
Returned the set (tuple) of toMany relationships' names defined by the underlying Entity.
  allToOneRelationshipKeys(self)
Returned the set (tuple) of toOne relationships' names defined by the underlying Entity.
  attributesKeys(self)
Returns the set (tuple) of Attributes that are designated as class properties in the underlying Entity.
  awakeObjectFromFetch(self, object, editingContext)
latter
  awakeObjectFromInsertion(self, object, editingContext)
latter
  classDescriptionForDestinationKey(self, aKey)
Returns the class description registered for the destination entity of the underlying Entity's relationship 'aKey'
  classForInstances(self)
  createInstanceWithEditingContext(self, editingContext)
Returns an instance of the appropriate class, as specified by the underlying 'entity.className()'.
  deleteRuleForRelationshipKey(self, aKey)
  displayNameForKey(self, aKey)
  entity(self)
Returns the underlying entity
  entityName(self)
Returns the undelying entity's name
  foreignKeys(self)
Returns the names of foreign keys for the object, i.e.
  inverseForRelationshipKey(self, aKey)
  primaryKeys(self)
Returns the names of primary keys for the object.
  propagateDeleteForObject(self, anObject, editingContext)
Examines the deleted object's relationships and their delete rules, and takes the appropriate action.
  propagateInsertionForObject(self, anObject, editingContext)
Examines the object's relationships and searches for related objects not inserted in 'editingContext', then inserts these objects into editingContext if they are not already registered.
  rootClassDescription(self)
Returns the ClassDescription being the root of the inheritance hierarchy to which the current ClassDescription is bound, or 'self' if it does not participate in an inheritance hierarchy
  superClassDescription(self)
Returns the class description being the parent of the current ClassDescription, or 'None' if the latter does not participate in an inheritance hierarchy.
  toManyRelationshipKeys(self)
See also: allToManyRelationshipKeys()
  toOneRelationshipKeys(self)
See also: allToOneRelationshipKeys()
  userPresentableDescriptionForObject(self, anObject)
  validateObjectForDelete(self, anObject)
Checks that for every relationship declared with a 'DELETE_DENY' rule, 'anObject' has no more objects for that key ; if it does, it raises 'Validation.ValidationException'.
  validateObjectForSave(self, anObject)
Currently does nothing, just returns
  validateValueForKey(self, aValue, aKey)
  XMLDescriptionForObject(self, anObject)
Returns an DOM representing the object
    Inherited from ClassDescription
  classDescriptionForName(name)
Returns the ClassDescription corresponding to name (Static method)
  classDescriptionForObject(anObject)
Returns the ClassDescription associated to the object 'anObject' (Static method)
  delegate(self)
See interfaces.ClassDescription for details
  invalidateClassDescriptionCache()
Simply empties the set of held class description (Static method)
  registerClassDescription(aClassDescription, name)
Assigns the supplied classDescription to 'name'. (Static method)
  registeredNames()
Returns the registered names (Static method)
  registerProvider(self, aProvider)
  setDelegate(self, aDelegate)
See interfaces.ClassDescription for details
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Class Variable Summary
tuple __implements__ = (<class Modeling.interfaces.ClassDescri...

Instance Method Details

__init__(self, anEntity)
(Constructor)

Initializes a classe description with the supplied entity.
Overrides:
__builtin__.object.__init__

adaptorName(self)

Returns the name of the adaptor (like: 'Postgres') which is used to make persistent the corresponding instances
Overrides:
Modeling.ClassDescription.ClassDescription.adaptorName

allAttributesKeys(self)

Returned the set of Attributes defined by the underlying Entity.

See also: attributesKeys()

allToManyRelationshipKeys(self)

Returned the set (tuple) of toMany relationships' names defined by the underlying Entity.

See also: toManyRelationshipKeys()

allToOneRelationshipKeys(self)

Returned the set (tuple) of toOne relationships' names defined by the underlying Entity.

See also: toOneRelationshipKeys()

attributesKeys(self)

Returns the set (tuple) of Attributes that are designated as class properties in the underlying Entity.

See also: allAttributesKeys()

Overrides:
Modeling.ClassDescription.ClassDescription.attributesKeys

awakeObjectFromFetch(self, object, editingContext)

latter
Overrides:
Modeling.ClassDescription.ClassDescription.awakeObjectFromFetch

awakeObjectFromInsertion(self, object, editingContext)

latter
Overrides:
Modeling.ClassDescription.ClassDescription.awakeObjectFromInsertion

classDescriptionForDestinationKey(self, aKey)

Returns the class description registered for the destination entity of the underlying Entity's relationship 'aKey'
Overrides:
Modeling.ClassDescription.ClassDescription.classDescriptionForDestinationKey

createInstanceWithEditingContext(self, editingContext)

Returns an instance of the appropriate class, as specified by the underlying 'entity.className()'. The default implementation searches a class 'entity.className()' in a module 'entity.model'.

You can provide your own logic by providing a delegate to the classDescription which implements method 'classForClassDescription()'. If the delegate returns None, than it falls back to the standard behaviour.

Raises ValueError if such an instance cannot be created.

Overrides:
Modeling.ClassDescription.ClassDescription.createInstanceWithEditingContext

deleteRuleForRelationshipKey(self, aKey)

Overrides:
Modeling.ClassDescription.ClassDescription.deleteRuleForRelationshipKey

displayNameForKey(self, aKey)

Overrides:
Modeling.ClassDescription.ClassDescription.displayNameForKey

entity(self)

Returns the underlying entity

entityName(self)

Returns the undelying entity's name
Overrides:
Modeling.ClassDescription.ClassDescription.entityName

foreignKeys(self)

Returns the names of foreign keys for the object, i.e. the source attributes' names of to-one relationships.

See also: toOneRelationshipKeys(), allToOneRelationshipKeys()

Overrides:
Modeling.ClassDescription.ClassDescription.foreignKeys

inverseForRelationshipKey(self, aKey)

Overrides:
Modeling.ClassDescription.ClassDescription.inverseForRelationshipKey

primaryKeys(self)

Returns the names of primary keys for the object.
Overrides:
Modeling.ClassDescription.ClassDescription.primaryKeys

propagateDeleteForObject(self, anObject, editingContext)

Examines the deleted object's relationships and their delete rules, and takes the appropriate action.

The process of propagating the deletion of an objects examines each relationship, then acts that way:

  • if the delete rule is 'DELETE_NOACTION', simply returns
  • same for 'DELETE_DENY': we leave things untouched and wait for the validation process to raise the appropriate error for such inconsistencies
  • if the delete rule is 'DELETE_NULLIFY', the relation(s) the deleted object has with other object(s) is/are dismissed so that the graph of objects is left consistent afterwards
  • if the delete rule is 'DELETE_CASCADE', objects in relation with the deleted object are also deleted --this is obviously detected by the EditingContext which will then ask them to propagate their deletion as well.
See also: CustomObject.propagateDeleteWithEditingContext()
EditingContext.processRecentChanges()

Implementation notes:

The propagation process is not optimized at all.
Overrides:
Modeling.ClassDescription.ClassDescription.propagateDeleteForObject

propagateInsertionForObject(self, anObject, editingContext)

Examines the object's relationships and searches for related objects not inserted in 'editingContext', then inserts these objects into editingContext if they are not already registered.

It is normally called when an EditingContext gets the processRecentChanges() message.

See also: EditingContext.propagatesInsertionForRelatedObjects()

Overrides:
Modeling.ClassDescription.ClassDescription.propagateInsertionForObject

rootClassDescription(self)

Returns the ClassDescription being the root of the inheritance hierarchy to which the current ClassDescription is bound, or 'self' if it does not participate in an inheritance hierarchy

See also: superClassDescription(), Entity.rootEntity()

superClassDescription(self)

Returns the class description being the parent of the current ClassDescription, or 'None' if the latter does not participate in an inheritance hierarchy.

See also: rootClassDescription(), Entity.parentEntity()

toManyRelationshipKeys(self)

See also: allToManyRelationshipKeys()
Overrides:
Modeling.ClassDescription.ClassDescription.toManyRelationshipKeys

toOneRelationshipKeys(self)

See also: allToOneRelationshipKeys()
Overrides:
Modeling.ClassDescription.ClassDescription.toOneRelationshipKeys

userPresentableDescriptionForObject(self, anObject)

Overrides:
Modeling.ClassDescription.ClassDescription.userPresentableDescriptionForObject

validateObjectForDelete(self, anObject)

Checks that for every relationship declared with a 'DELETE_DENY' rule, 'anObject' has no more objects for that key ; if it does, it raises 'Validation.ValidationException'.

See also: CustomObject.validateForDelete(),
Relationship.deleteRule()
Overrides:
Modeling.ClassDescription.ClassDescription.validateObjectForDelete

validateObjectForSave(self, anObject)

Currently does nothing, just returns
Overrides:
Modeling.ClassDescription.ClassDescription.validateObjectForSave

XMLDescriptionForObject(self, anObject)

Returns an DOM representing the object
Overrides:
Modeling.ClassDescription.ClassDescription.XMLDescriptionForObject

Class Variable Details

__implements__

Type:
tuple
Value:
(<class Modeling.interfaces.ClassDescription.ClassDescriptionInterface\
 at 0xb788c3ec>,)                                                      

Generated by Epydoc 2.1 on Sat Mar 4 13:36:24 2006 http://epydoc.sf.net