Package org.molgenis.data.cache.l3
Class L3CacheRepositoryDecorator
- java.lang.Object
-
- com.google.common.collect.ForwardingObject
-
- org.molgenis.data.AbstractRepositoryDecorator<Entity>
-
- org.molgenis.data.cache.l3.L3CacheRepositoryDecorator
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Iterable<Entity>,Repository<Entity>
public class L3CacheRepositoryDecorator extends AbstractRepositoryDecorator<Entity>
Retrieves identifiers from theL3Cachebased on aQueryifRepositoryCapability.CACHEABLE.Delegates to the underlying
Repository
-
-
Constructor Summary
Constructors Constructor Description L3CacheRepositoryDecorator(Repository<Entity> delegateRepository, L3Cache l3Cache, TransactionInformation transactionInformation)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stream<Entity>findAll(Query<Entity> query)Retrieves aListof identifiers from theL3Cacheif theRepositoryis cacheable and theQueryis limited (i.e.EntityfindOne(Query<Entity> query)Retrieves a single identifier from theL3Cacheif theRepositoryis cacheable and hasn't been touched in this transaction.-
Methods inherited from class org.molgenis.data.AbstractRepositoryDecorator
add, add, aggregate, close, count, count, delegate, delete, delete, deleteAll, deleteAll, deleteById, findAll, findAll, findOneById, findOneById, 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
-
L3CacheRepositoryDecorator
public L3CacheRepositoryDecorator(Repository<Entity> delegateRepository, L3Cache l3Cache, TransactionInformation transactionInformation)
-
-
Method Detail
-
findAll
public Stream<Entity> findAll(Query<Entity> query)
Retrieves aListof identifiers from theL3Cacheif theRepositoryis cacheable and theQueryis limited (i.e. contains a pageSize) between 0 and MAX_PAGE_SIZE- Specified by:
findAllin interfaceRepository<Entity>- Overrides:
findAllin classAbstractRepositoryDecorator<Entity>- Parameters:
query- TheQuery- Returns:
- A stream of
Entity
-
findOne
public Entity findOne(Query<Entity> query)
Retrieves a single identifier from theL3Cacheif theRepositoryis cacheable and hasn't been touched in this transaction.- Specified by:
findOnein interfaceRepository<Entity>- Overrides:
findOnein classAbstractRepositoryDecorator<Entity>- Parameters:
query- TheQuery- Returns:
- A single
Entityor null if not found
-
-