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

Class KeyGlobalID


KeyGlobalID

Important note: the internal state of KeyGlobalID objects is considered
read-only, and at no time the framework expects their internal values to change. Trying to change them will certainly trigger wrong and possibly bad behaviour, including (not exhaustively): loss of data, apparition of dangling references, confusion in the objects' changes that are made persistent, etc.

Method Summary
  __init__(self, entityName, keyValues)
Initializes a new GlobalID with the following parameters:
  __cmp__(self, aGlobalId)
  __eq__(self, aGlobalId)
Compares self with 'aGlobalID'
  __hash__(self)
  __setattr__(self, name, value)
Raises TypeError since this is an immutable object
  __str__(self)
Returns a string representation of the GlobalID.
  entityName(self)
  isTemporary(self)
Returns 'false'.
  keyCount(self)
Returns the number of entries supplied in 'keyValues' when the GlobalID was initialized.
  keyValues(self)
Return the object's key values, as specified when the object was initialized.
  _buildHashCode(self)
Computes the hash code for the object.

Class Variable Summary
tuple __implements__ = (<class Modeling.interfaces.GlobalID.IK...
int __is_temporary__ = 0                                                                     

Method Details

__init__(self, entityName, keyValues)
(Constructor)

Initializes a new GlobalID with the following parameters:

Parameters:

entityName -- the name of the corresponding object's entityName
(remember a GlobalID acts as a label that sticks to a particular object),
keyValues -- a dictionary ; the entity's primary key(s)'s names are its
keys, map to their respective values.

__eq__(self, aGlobalId)
(Equality operator)

Compares self with 'aGlobalID'

A GlobalID is equal to another one iff:

  • they both are GlobalIDs (either KeyGlobalID or TemporaryGlobalID)
  • they both are KeyGlobalID, with the same entityName() and keyValues()
  • they both are TemporaryGlobalID, with the same internal state (as exposed by __str__)

__setattr__(self, name, value)

Raises TypeError since this is an immutable object

__str__(self)
(Informal representation operator)

Returns a string representation of the GlobalID. This string representation is unique among GlobalIDs.

isTemporary(self)

Returns 'false'.

keyCount(self)

Returns the number of entries supplied in 'keyValues' when the GlobalID was initialized. For example, if an object is stored in the database in a table which has a simple (as opposed to a compound-) primary key, its GlobalID will return '1' (one).

keyValues(self)

Return the object's key values, as specified when the object was initialized.

See also: __init__()

_buildHashCode(self)

Computes the hash code for the object.

Class Variable Details

__implements__

Type:
tuple
Value:
(<class Modeling.interfaces.GlobalID.IKeyGlobalID at 0xb788c92c>,)     

__is_temporary__

Type:
int
Value:
0                                                                     

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