Class ReadThroughEntityCache<CACHEKEY extends Serializable,​ENTITYID extends Serializable,​ENTITY>

  • Type Parameters:
    CACHEKEY - the cache key type. Must be Serializable.
    ENTITYID - the entity ID type, used as the value in the cache. Must be Serializable.
    ENTITY - the entity type, as will be returned from the get(Serializable, Supplier, Predicate) method
    All Implemented Interfaces:
    ReadThroughCache<CACHEKEY,​ENTITY>

    public final class ReadThroughEntityCache<CACHEKEY extends Serializable,​ENTITYID extends Serializable,​ENTITY>
    extends Object
    implements ReadThroughCache<CACHEKEY,​ENTITY>
    An implementation of ReadThroughCache which caches the IDs of entity objects against arbitrary keys. When fetched from the cache, the IDs will be deferenced back to the required entity objects before being returned.

    Contains logic to handle cases where the cache contains a stale entity ID, i.e. where an entity for that ID no longer exists.

    Since:
    7.5