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

Type UniquingTable

object --+
         |
        UniquingTable


The uniquing table - encapsulate the dictionary structure Defines the standard behaviour for methods: 'globalIDForObject()', 'objectForGlobalID', etc.

Its goal is to guarantee that the uniquing principle is enforced, i.e. that one given row in the database cannot be represented by more than one object within the EditingContext.

Since faults / ghosted object are usually identified by their so-called ``root GlobalID'' (a root GlobalID has exactly the same keyValues() than the real GlobalID but has an entityName() referring to the root Entity, not the object's actual Entity ; this is because the actual Entity for an object can only be known when data for that object is actually fetched against the database), the UniquingTable also keeps track of root globalIDs in order to be able to serve objects from globalID being either the root and the real GlobalID.


Method Summary
  __init__(self)
  addObjectForGlobalID(self, anObject, aGlobalID)
  clear(self)
Clear all entries
  forgetObject(self, object)
Removes the object and the corresponding GlobalID from the uniquing table
  forgetObjectForGlobalID(self, aGlobalID)
Removes the GlobalID and the corresponding object from the uniquing table
  globalIDForObject(self, anObject)
Returns the GlobalId registered with that object, or 'None' if it cannot be found
  globalIDs(self)
  hasGlobalID(self, aGlobalID)
  hasObject(self, anObject)
  objectForGlobalID(self, aGlobalID)
Returns the object corresponding to the given 'aGlobalID', or 'None' if it cannot be found in the receiver's uniquing table.
  objects(self)
    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)

Method Details

clear(self)

Clear all entries

forgetObject(self, object)

Removes the object and the corresponding GlobalID from the uniquing table

forgetObjectForGlobalID(self, aGlobalID)

Removes the GlobalID and the corresponding object from the uniquing table

globalIDForObject(self, anObject)

Returns the GlobalId registered with that object, or 'None' if it cannot be found

objectForGlobalID(self, aGlobalID)

Returns the object corresponding to the given 'aGlobalID', or 'None' if it cannot be found in the receiver's uniquing table.

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