ID
- the ID typeT
- the entity typepublic abstract class AbstractCoherenceAsyncRepository<T,ID>
extends com.oracle.coherence.repository.AbstractAsyncRepository<ID,T>
implements io.micronaut.data.repository.GenericRepository<T,ID>
io.micronaut.data.repository.async.AsyncCrudRepository
with
CoherenceRepository
and use Coherence as a backend cache. However,
to take full advantage of the feature set Coherence has to offer, it is recommended extending this class. This
will give you all of the features as documented in AbstractAsyncRepository
.
Any class extending this class must be declared abstract and cannot implement any of
the Micronaut repository types due to overlap in methods between those interface methods and those provided
by AbstractAsyncRepository
.Constructor and Description |
---|
AbstractCoherenceAsyncRepository() |
Modifier and Type | Method and Description |
---|---|
protected java.lang.Class<? extends T> |
getEntityType() |
protected abstract java.lang.Class<? extends T> |
getEntityTypeInternal(T entity)
This is in place to prevent Micronaut from scanning further up the inheritance tree and trying
to map
AbstractRepositoryBase.getEntityType() and failing. |
protected ID |
getId(T t) |
protected abstract ID |
getIdInternal(T entity)
This is in place to prevent Micronaut from scanning further up the inheritance tree and trying
to map
AbstractRepositoryBase.getId(Object) and failing. |
protected com.tangosol.net.AsyncNamedMap<ID,T> |
getMap() |
protected abstract com.tangosol.net.AsyncNamedMap<ID,T> |
getMapInternal()
This is in place to prevent Micronaut from scanning further up the inheritance tree and trying
to map
AbstractRepositoryBase.getMap() and failing. |
java.util.concurrent.CompletableFuture<java.lang.Boolean> |
remove(T entity) |
java.util.concurrent.CompletableFuture<T> |
save(T entity) |
average, average, average, average, average, average, average, average, count, count, distinct, distinct, exists, get, get, getAll, getAll, getAll, getAll, getAll, getAll, getAll, getAll, getAll, getAll, getAll, getAll, getAllOrderedBy, getAllOrderedBy, getAllOrderedBy, getAllOrderedBy, groupBy, groupBy, groupBy, groupBy, groupBy, groupBy, groupBy, groupBy, max, max, max, max, max, max, max, max, max, max, maxBy, maxBy, min, min, min, min, min, min, min, min, min, min, minBy, minBy, remove, removeAll, removeAll, removeAll, removeAll, removeAll, removeAll, removeAllById, removeAllById, removeById, removeById, saveAll, saveAll, sum, sum, sum, sum, sum, sum, sum, sum, top, top, top, top, topBy, topBy, topBy, topBy, update, update, update, update, update, update, updateAll, updateAll, updateAll
protected java.lang.Class<? extends T> getEntityType()
public java.util.concurrent.CompletableFuture<java.lang.Boolean> remove(T entity)
protected abstract ID getIdInternal(T entity)
AbstractRepositoryBase.getId(Object)
and failing.
Called only by getId(Object)
.entity
- the entityprotected abstract com.tangosol.net.AsyncNamedMap<ID,T> getMapInternal()
AbstractRepositoryBase.getMap()
and failing.
Called only by getId(Object)
.AsyncNamedMap
for this repository
protected abstract java.lang.Class<? extends T> getEntityTypeInternal(T entity)
AbstractRepositoryBase.getEntityType()
and failing.
Note: the value passed to this may always be null
. We don't care about the value
as due to how the Coherence API is defined, there can never be a value. However, we can rely
on the compile type information generated by Micronaut for this intercepted method and use that metadata
to return the entity type.
Called only by getEntityType()
.entity
- the entityClass
representing the entity type handled by this repository
.