public class L2CacheRepositoryDecorator extends AbstractRepositoryDecorator<Entity>
L2Cache when a Repository is RepositoryCapability.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 and Description |
|---|
L2CacheRepositoryDecorator(Repository<Entity> delegateRepository,
L2Cache l2Cache,
TransactionInformation transactionInformation) |
| Modifier and Type | Method and Description |
|---|---|
Stream<Entity> |
findAll(Stream<Object> ids)
Retrieves multiple entities by id.
|
Stream<Entity> |
findAll(Stream<Object> ids,
Fetch fetch) |
Entity |
findOneById(Object id)
Retrieves a single entity by id.
|
Entity |
findOneById(Object id,
Fetch fetch) |
add, add, aggregate, close, count, count, delegate, delete, delete, deleteAll, deleteAll, deleteById, findAll, findOne, forEachBatched, getCapabilities, getEntityType, getName, getQueryOperators, iterator, query, update, updateclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEachBatched, getExistingIDs, upsertBatchforEach, spliteratorpublic L2CacheRepositoryDecorator(Repository<Entity> delegateRepository, L2Cache l2Cache, TransactionInformation transactionInformation)
public Entity findOneById(Object id)
findOneById in interface Repository<Entity>findOneById in class AbstractRepositoryDecorator<Entity>id - the entity's ID valuepublic Stream<Entity> findAll(Stream<Object> ids)
If the repository is cacheable and the current transaction hasn't completely dirtied it,
will split the stream into batches and load the batches through findAllBatch(List).
Otherwise, will delegate this call to the decorated repository.
findAll in interface Repository<Entity>findAll in class AbstractRepositoryDecorator<Entity>ids - Stream of ids to retrieveStream of retrieved Entitys, missing ones excludedpublic Stream<Entity> findAll(Stream<Object> ids, Fetch fetch)
findAll in interface Repository<Entity>findAll in class AbstractRepositoryDecorator<Entity>public Entity findOneById(Object id, Fetch fetch)
findOneById in interface Repository<Entity>findOneById in class AbstractRepositoryDecorator<Entity>Copyright © 2018 Pivotal Software, Inc.. All rights reserved.