Package org.molgenis.data.cache.l2
Class L2CacheRepositoryDecorator
- java.lang.Object
-
- com.google.common.collect.ForwardingObject
-
- org.molgenis.data.AbstractRepositoryDecorator<Entity>
-
- org.molgenis.data.cache.l2.L2CacheRepositoryDecorator
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Iterable<Entity>,Repository<Entity>
public class L2CacheRepositoryDecorator extends AbstractRepositoryDecorator<Entity>
Adds, removes and retrieves entities from theL2Cachewhen aRepositoryisRepositoryCapability.CACHEABLE.Delegates to the underlying repository when an action is not supported by the cache or when the cache doesn't contain the needed entity.
-
-
Constructor Summary
Constructors Constructor Description L2CacheRepositoryDecorator(Repository<Entity> delegateRepository, L2Cache l2Cache, TransactionInformation transactionInformation)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stream<Entity>findAll(Stream<Object> ids)Stream<Entity>findAll(Stream<Object> ids, Fetch fetch)EntityfindOneById(Object id)Retrieves a single entity by id.EntityfindOneById(Object id, Fetch fetch)-
Methods inherited from class org.molgenis.data.AbstractRepositoryDecorator
add, add, aggregate, close, count, count, delegate, delete, delete, deleteAll, deleteAll, deleteById, findAll, findOne, forEachBatched, getCapabilities, getEntityType, getName, getQueryOperators, iterator, query, update, update
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface org.molgenis.data.Repository
forEachBatched, getExistingIDs, upsertBatch
-
-
-
-
Constructor Detail
-
L2CacheRepositoryDecorator
public L2CacheRepositoryDecorator(Repository<Entity> delegateRepository, L2Cache l2Cache, TransactionInformation transactionInformation)
-
-
Method Detail
-
findOneById
public Entity findOneById(Object id)
Retrieves a single entity by id.- Specified by:
findOneByIdin interfaceRepository<Entity>- Overrides:
findOneByIdin classAbstractRepositoryDecorator<Entity>- Parameters:
id- the entity's ID value- Returns:
- the retrieved Entity, or null if not present.
-
findAll
public Stream<Entity> findAll(Stream<Object> ids)
- Specified by:
findAllin interfaceRepository<Entity>- Overrides:
findAllin classAbstractRepositoryDecorator<Entity>
-
findAll
public Stream<Entity> findAll(Stream<Object> ids, Fetch fetch)
- Specified by:
findAllin interfaceRepository<Entity>- Overrides:
findAllin classAbstractRepositoryDecorator<Entity>
-
findOneById
public Entity findOneById(Object id, Fetch fetch)
- Specified by:
findOneByIdin interfaceRepository<Entity>- Overrides:
findOneByIdin classAbstractRepositoryDecorator<Entity>
-
-