This package provides classes for caching of objects materialized from a datastore.
Applications use the ObjectCacheFactory to create new ObjectCaches.
These caches supply methods for storing and retrieving objects.
Objects can be looked up by their identity which is represented by the class Identiy.
Each implementation of ObjectCache represents a different caching strategy.
The ObjectCache stores all Objects loaded by the
org.apache.ojb.broker.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.
Using an ObjectCache has several advantages:
- it increases performance as it reduces DB lookups.
- it allows to perform circular lookups (as by crossreferenced objects)
that would result in non-terminating loops without such a cache.