Class CombinedEntityCache


  • public class CombinedEntityCache
    extends Object
    Caches CacheHits with Entitys from different repositories in dehydrated form in a single combined Guava Cache.
    • Method Detail

      • putDeletion

        public void putDeletion​(EntityKey entityKey)
        Caches the deletion of an entity instance.
        Parameters:
        entityKey - the EntityKey of the deleted entity instance
      • evictAll

        public void evictAll​(EntityType entityType)
        Evicts all entries from the cache that belong to a certain entityType.
        Parameters:
        entityType - the id of the entity whose entries are to be evicted
      • getIfPresent

        public Optional<CacheHit<Entity>> getIfPresent​(EntityType entityType,
                                                       Object id,
                                                       @Nullable @CheckForNull
                                                       Fetch fetch)
        Retrieves an entity from the cache if present.
        Parameters:
        entityType - EntityType of the entity to retrieve
        id - id value of the entity to retrieve
        fetch - containing attributes to retrieve, can be null
        Returns:
        Optional CacheHit with the result from the cache, empty if no record of the entity is present in the cache
      • put

        public void put​(Entity entity)
        Inserts an entity into the cache.
        Parameters:
        entity - the entity to insert into the cache