public class SimpleGemfireRepository<T,ID> extends Object implements GemfireRepository<T,ID>
PagingAndSortingRepository / CrudRepository implementation for Apache Geode.Cache,
CacheTransactionManager,
Region,
GemfireTemplate,
GemfireRepository,
CrudRepository,
PagingAndSortingRepository,
EntityInformation| Modifier and Type | Field and Description |
|---|---|
protected static String |
SELECT_COUNT_OQL_QUERY |
| Constructor and Description |
|---|
SimpleGemfireRepository(GemfireTemplate template,
EntityInformation<T,ID> entityInformation)
Constructs a new instance of
SimpleGemfireRepository initialized with the GemfireTemplate
and EntityInformation. |
| Modifier and Type | Method and Description |
|---|---|
long |
count()
Counts the number of entities stored in the
Region. |
void |
delete(T entity) |
void |
deleteAll() |
void |
deleteAll(Iterable<? extends T> entities) |
void |
deleteAllById(Iterable<? extends ID> ids) |
void |
deleteById(ID id) |
boolean |
existsById(ID id)
Determines whether an entity with the given ID is stored in the
Region. |
Iterable<T> |
findAll() |
Page<T> |
findAll(Pageable pageable) |
Iterable<T> |
findAll(Sort sort) |
Iterable<T> |
findAllById(Iterable<ID> ids) |
Optional<T> |
findById(ID id) |
EntityInformation<T,ID> |
getEntityInformation()
Returns a reference to the
EntityInformation type describing the entity. |
org.slf4j.Logger |
getLogger()
Returns a reference to the SLF4J
Logger used to log the operations of this GemfireRepository. |
org.apache.geode.cache.Region<ID,T> |
getRegion()
Gets the
Region to which this GemfireRepository performs all data access operations. |
GemfireTemplate |
getTemplate()
Returns a reference to the
GemfireTemplate used by this GemfireRepository to perform basic
CRUD and simple OQL queries data access operations |
<U extends T> |
save(U entity) |
T |
save(Wrapper<T,ID> wrapper)
Save the entity wrapped by the given
Wrapper. |
<U extends T> |
saveAll(Iterable<U> entities) |
protected static final String SELECT_COUNT_OQL_QUERY
public SimpleGemfireRepository(@NonNull GemfireTemplate template, @NonNull EntityInformation<T,ID> entityInformation)
SimpleGemfireRepository initialized with the GemfireTemplate
and EntityInformation.template - GemfireTemplate used to perform basic data access operations and simple OQL queries;
must not be null.entityInformation - EntityInformation that describes the entity; must not be null.IllegalArgumentException - if GemfireTemplate or EntityInformation is null.GemfireTemplate,
EntityInformation@NonNull public EntityInformation<T,ID> getEntityInformation()
EntityInformation type describing the entity.EntityInformation type describing the entity.EntityInformation@NonNull public org.slf4j.Logger getLogger()
Logger used to log the operations of this GemfireRepository.Logger used to log the operations of this GemfireRepository.Logger@NonNull public org.apache.geode.cache.Region<ID,T> getRegion()
Region to which this GemfireRepository performs all data access operations.Region on which this GemfireRepository operates.Region,
getTemplate()@NonNull public GemfireTemplate getTemplate()
GemfireTemplate used by this GemfireRepository to perform basic
CRUD and simple OQL queries data access operationsGemfireTemplate used by this GemfireRepository.GemfireTemplatepublic <U extends T> U save(@NonNull U entity)
save in interface CrudRepository<T,ID>public T save(@NonNull Wrapper<T,ID> wrapper)
GemfireRepositoryWrapper.public <U extends T> Iterable<U> saveAll(@NonNull Iterable<U> entities)
saveAll in interface CrudRepository<T,ID>public long count()
Region.
This method executes a SELECT count(*) FROM /Region OQL query.count in interface CrudRepository<T,ID>Region.public boolean existsById(ID id)
Region.existsById in interface CrudRepository<T,ID>id - Long value identifying the entity.Region.findById(Object)@NonNull public Iterable<T> findAll()
findAll in interface CrudRepository<T,ID>public Page<T> findAll(@NonNull Pageable pageable)
findAll in interface PagingAndSortingRepository<T,ID>@NonNull public Iterable<T> findAll(@NonNull Sort sort)
findAll in interface PagingAndSortingRepository<T,ID>@NonNull public Iterable<T> findAllById(@NonNull Iterable<ID> ids)
findAllById in interface CrudRepository<T,ID>public Optional<T> findById(@NonNull ID id)
findById in interface CrudRepository<T,ID>public void deleteAll()
deleteAll in interface CrudRepository<T,ID>public void deleteAll(@NonNull Iterable<? extends T> entities)
deleteAll in interface CrudRepository<T,ID>public void deleteAllById(@NonNull Iterable<? extends ID> ids)
deleteAllById in interface CrudRepository<T,ID>public void deleteById(@NonNull ID id)
deleteById in interface CrudRepository<T,ID>Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.