A mutable second-class HashMap object.
SCO fields declared as type java.util.Map or java.util.HashMap are populated
with objects of this type whenever the owning object is actively being
managed by a state manager.
While an SCO HashMap is owned it is considered either transient or
persistent according to whether its owner is in a transient or
persistent state.
While the owner/map is transient:
-
Entries are restricted to be of the designated key & value type.
-
All write operations cause the corresponding field in the owner to be
marked dirty.
In addition to the above, while the owner/map is persistent:
-
The contents of the map may or may not be fully loaded in memory.
If they are loaded within a transaction they are considered "up-to-date"
only until the next update of the data store.
-
Some read operations (get(), size(), isEmpty(), containsKey(),
containsValue()) "pass through" directly to the database if the memory
contents are not up-to-date.
This avoids an expensive load from the data store for operations that
don't necessarily involve the entire map.
All other read operations by nature must access the entire map and so
they always load the contents, or reload them if they are not up-to-date.
-
All write operations always pass through directly to the database,
although the memory copy is also updated.
No write operation requires the contents to be loaded.
An instance of this class is always associated with a backing store, although
the store is only used when the map is persistent.
The map disconnects from its owner when
HashMap.unsetOwner is called.
This occurs automatically in a variety of scenarios, such as when the object
is cloned or when its owning object (the one whose Map field refers to it)
transitions to a unmanaged state.
When a disconnect occurs the object subsequently behaves as a normal HashMap.
Subsequent changes affect only the memory contents.
Once disconnected from its owner an instance can never be reconnected.
author: Mike Martin version: $Revision: 1.3 $ |