Home | Trees | Index | Help |
|
---|
Package Modeling :: Package interfaces :: Module Relationship :: Class RelationshipInterface |
|
Base
--+
|
RelationshipInterface
Responsible for class descriptions class Relationship(Persistent, XMLCapability): Describes a relationship Implementation notes: - join semantic is not used for the moment being, and defaults to INNER_JOIN Features added to the EOF standard API: - cardinality of the relationship [Tableau suivant à verifier avec le Modeler]:: SimpleRel. FlattenedRel. definition get y:None Y set N Y deleteRule get Y Y set Y Y displayLabel get Y Y set Y Y entity get Y Y set Y Y isClassProp. get Y Y set Y Y joins get Y y:() set Y N joinSemantic get Y N set Y N name get Y Y set Y Y mult.Lower get Y Y? set Y Y? mult.Upper get Y Y? set Y Y? propagatesPK get Y y:false set Y N ownsDestinat.get Y ? set Y ? funcs.: componentRelationship y:() Y destinationAttributes Y y? destinationEntity Y Y inverseRelationship Y Y isCompound Y N? (see isSimple) isFlattened Y Y isMandatory Y Y? (see 'Y?' for multiplicities) isSimple Y N? (see isCompound) isToOne Y Y? (|see isToMany Y Y? (| 'Y?' for multiplicities)
Method Summary | |
---|---|
Initializes a relationship. | |
Tests whether both relationship are equal | |
Adds a join to the relationship | |
Checks the relationship validity. | |
Returns the sequence of (non flattened) relationships involved in the flattened relationship, or 'None' if the receiver is not flattened See also: definition | |
Returns the definition (keypath) for the flattened relationship, or 'None' if the relationship is not flattened See also: componentRelationships | |
Returns the delete rule applicable to this relationship. | |
Simply returns the list of joins' destination attributes | |
Returns the destination entity, or 'None' if the relationship has no joins yet | |
Return the destination entity, or None | |
Returns the display label for the relationship | |
Return the relationship's source entity | |
Returns the (DOM) DocumentObject for the receiver. | |
Initializes a relationship with the supplied xml.dom.node. | |
Returns the inverse relationship in the destination entity, or None if it does not exist. | |
Indicates whether the attribute belongs to the class properties/fields | |
Simply indicates whether the relationship has one or more joins Returns true iff relationship has one join, false otherwise. | |
Returns true (integer '1') if the receiver is flattened, false ('0') otherwise See also: definition, componentRelationships | |
Indicates whether the relationship requires at least a destination entity to be bound. | |
Indicates whether the relation holds one join. | |
Indicates whether the relationship has a maximum cardinality > 1. | |
Indicates whether the relationship has a maximim cardinality = 1. | |
Return the whole set of joins registered in this relationship | |
Returns the lower bound of the relationship's multiplicity | |
Returns the upper bound of the relationship's multiplicity. | |
Returns the relationship's name | |
Returns true if the relationship owns the destinationEntity. | |
Returns true if the relationship propagates PK value, false otherwise _TBD should be explained | |
Removes the supplied join from the relation's join. | |
Sets the definition for the receiver, making it a flattened relationship | |
Sets the delete rule. | |
Sets the display label (string) for the relationship | |
Sets the source entity | |
Tells the receiver whether it belongs to the class properties/fields | |
Tells the relationship whether it is mandatory. | |
Sets the lower and upper bounds for the relationship's multiplicity. | |
Sets the lower bound of the relationship's multiplicity Parameter lowerBound must be an positive integer. | |
Sets the upper bound of the relationship's multiplicity. | |
Sets the relationship's name | |
Tells the receiver whether it owns its destination objects. | |
Tells the relationship whether it propagates PK value _TBD should be explained | |
Simply returns the list of joins' source attributes | |
Return the relationship's source entity | |
Validates the relationship against general model consistency: - relationship should have a source and a destination entity - | |
Checks whether the supplied value is valid, i.e. | |
. |
Method Details |
---|
__init__(self,
aName='')
|
__eq__(self,
aRelationship)
Tests whether both relationship are equal |
addJoin(self, aJoin)Adds a join to the relationship Raises ValueError if aJoin's source attribute does not belong to receiver's entity, if either aJoin's source or destination attribute is already registered in an other relationship's join, or if aJoin's destination entity does not equal to 'self.destinationEntity()' (if this one is not 'None'). |
checkRelationshipValidity(self)Checks the relationship validity. This includes the following tests: - cardinality > 0 - len(joins) > 0 - name - source and destinationEntity are not None - joins' sources are identical (idem for destinations) Raises the relation is invalid. |
componentRelationships(self)Returns the sequence of (non flattened) relationships involved in the flattened relationship, or 'None' if the receiver is not flattened See also: definition |
definition(self)Returns the definition (keypath) for the flattened relationship, or 'None' if the relationship is not flattened See also: componentRelationships |
deleteRule(self)Returns the delete rule applicable to this relationship. Possible values are module's integer constants DELETE_CASCADE, DELETE_NULLIFY and DELETE_DENY |
destinationAttributes(self)Simply returns the list of joins' destination attributes |
destinationEntity(self)Returns the destination entity, or 'None' if the relationship has no joins yet |
destinationEntityName(self)Return the destination entity, or None |
displayLabel(self)Returns the display label for the relationship |
entity(self)Return the relationship's source entity |
getXMLDOM(self, doc=None, parentNode=None, encoding='iso-8859-1')Returns the (DOM) DocumentObject for the receiver. Parameters 'doc' and 'parentDoc' should be both omitted or supplied. If they are omitted, a new DocumentObject is created. If they are supplied, elements are added to the parentNode. Returns: the (possibly new) DocumentObject. |
initWithXMLDOMNode(self, aNode, encoding='iso-8859-1')Initializes a relationship with the supplied xml.dom.node. Also take care of initializing joins |
inverseRelationship(self)Returns the inverse relationship in the destination entity, or None if it does not exist. The notion of inverse relationship is very precise: an inverse relationship has the same number of joins, and there is a bijective relation defined by 'Join.isReciprocicalTo' between both sets of joins. |
isClassProperty(self)Indicates whether the attribute belongs to the class properties/fields |
isCompound(self)Simply indicates whether the relationship has one or more joins Returns true iff relationship has one join, false otherwise. Raises if relationship has no joins. |
isFlattened(self)Returns true (integer '1') if the receiver is flattened, false ('0') otherwise See also: definition, componentRelationships |
isMandatory(self)Indicates whether the relationship requires at least a destination entity to be bound. This is a computed attribute, equivalent to: 'self.multiplicityLowerBound()>0'. |
isSimple(self)Indicates whether the relation holds one join. Note that this method return also 'true' when the relationship is invalid (i.e. it holds no joins) |
isToMany(self)Indicates whether the relationship has a maximum cardinality > 1. This is the contrary of method isToOne. |
isToOne(self)Indicates whether the relationship has a maximim cardinality = 1. This is the contrary of method isToMany. |
joins(self)Return the whole set of joins registered in this relationship |
multiplicityLowerBound(self)Returns the lower bound of the relationship's multiplicity |
multiplicityUpperBound(self)Returns the upper bound of the relationship's multiplicity. Returned value is a strictly positive integer, or -1 if there is no upper bound. |
name(self)Returns the relationship's name |
ownsDestination(self)Returns true if the relationship owns the destinationEntity. See also: setOwnsDestination() When a relationship owns its destination, the related entity object cannot exist without the source object. Thus, as a side-effect, this sets the delete rule to 'cascade'. |
propagatesPrimaryKey(self)Returns true if the relationship propagates PK value, false otherwise _TBD should be explained |
removeJoin(self, aJoin)Removes the supplied join from the relation's join. Parameter 'aJoin' must be a 'Join' instance. Raises 'ValueError' if 'aJoin' cannot be found. |
setDefinition(self)Sets the definition for the receiver, making it a flattened relationship |
setDeleteRule(self, rule)Sets the delete rule. Accepted values are module's constants: DELETE_NULLIFY, DELETE_CASCADE and DELETE_DENY |
setDisplayLabel(self, aLabel)Sets the display label (string) for the relationship |
setEntity(self, anEntity)Sets the source entity |
setIsClassProperty(self, aBool)Tells the receiver whether it belongs to the class properties/fields |
setIsMandatory(self, aBool)Tells the relationship whether it is mandatory. This method has the following side-effects: if set to 'true' and the multiplicity lower bound was '0' (zero) it is set to '1' (one) ; if set to 'false', the multiplicity lower bound is set to 'zero'. |
setMultiplicity(self, lowerBound, upperBound)Sets the lower and upper bounds for the relationship's multiplicity. See also: setMultiplicityLowerBound, setMultiplicityUpperBound. |
setMultiplicityLowerBound(self, lowerBound)Sets the lower bound of the relationship's multiplicity Parameter lowerBound must be an positive integer. |
setMultiplicityUpperBound(self, upperBound)Sets the upper bound of the relationship's multiplicity. Parameter 'upperBound' must be a strictly positive integer, or -1 for a non constrained to-many relationship. |
setName(self, aName)Sets the relationship's name |
setOwnsDestination(self, boolean)Tells the receiver whether it owns its destination objects. When a relationship owns its destination, the related object(s) cannot exist without the source object. Thus, as a side-effect, this sets the delete rule to 'cascade' when it is set to true. |
setPropagatesPrimaryKey(self, aBool)Tells the relationship whether it propagates PK value _TBD should be explained |
sourceAttributes(self)Simply returns the list of joins' source attributes |
sourceEntity(self)Return the relationship's source entity |
validateRelationship(self)Validates the relationship against general model consistency: - relationship should have a source and a destination entity - Unimplemented |
validateValue(self, value, object=None)Checks whether the supplied value is valid, i.e. the following tests are made:
Parameter 'value' is required, and 'object' is optional --it is only used to make the error message clearer in case of failure. Silently returns if it suceeds. In case of failure, it raises 'Modeling.Validation.Exception' ; in this case, exception's value ('sys.exc_info[1]') consists in a set of lines, describing line per line the different tests which failed. |
xmlAttributesDict(self). |
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Sat Mar 4 13:36:21 2006 | http://epydoc.sf.net |