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,
org.springframework.data.repository.core.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() |
org.springframework.data.domain.Page<T> |
findAll(org.springframework.data.domain.Pageable pageable) |
Iterable<T> |
findAll(org.springframework.data.domain.Sort sort) |
Iterable<T> |
findAllById(Iterable<ID> ids) |
Optional<T> |
findById(ID id) |
org.springframework.data.repository.core.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 org.springframework.data.repository.core.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 org.springframework.data.repository.core.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
.GemfireTemplate
public T save(@NonNull Wrapper<T,ID> wrapper)
GemfireRepository
Wrapper
.public long count()
Region
.
This method executes a SELECT count(*) FROM /Region OQL query.public boolean existsById(ID id)
Region
.existsById
in interface org.springframework.data.repository.CrudRepository<T,ID>
id
- Long
value identifying the entity.Region
.findById(Object)
public org.springframework.data.domain.Page<T> findAll(@NonNull org.springframework.data.domain.Pageable pageable)
public void deleteAll()
Copyright © 2011–2023 Pivotal Software, Inc.. All rights reserved.