public interface ObjectCache
ObjectCache
stores all Objects loaded by the
PersistenceBroker
from a DB.
When the PersistenceBroker tries to get an Object by its Primary key values
it first lookups the cache if the object has been already loaded and cached.
ObjectCacheDefaultImpl
.
PersistenceBroker
was
associated with its own ObjectCache
instance at creation
time.
ObjectCacheFactory
is responsible for creating ObjectCache
instances. To make the ObjectCache
implementation work, a
constructor with PersistenceBroker
and
Properties
as arguments or only PersistenceBroker
argument is needed.Modifier and Type | Method and Description |
---|---|
void |
cache(Identity oid,
java.lang.Object obj)
Used to cache objects by it's
Identity . |
void |
clear()
Clear the cache.
|
java.lang.Object |
lookup(Identity oid)
Lookup object with Identity 'oid' in cache.
|
void |
remove(Identity oid)
Removes an Object from the cache.
|
void cache(Identity oid, java.lang.Object obj)
Identity
.oid
- Identity of the object to cache.obj
- The object to cache.java.lang.Object lookup(Identity oid)
oid
- Identity of the object to search for.Identity
is found.void remove(Identity oid)
oid
- Identity of the object to be removed.void clear()
(C) 2002 - 2005 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.4, 2005-12-30