public interface KeyValueOperations extends DisposableBean
KeyValueTemplate.| Modifier and Type | Method and Description |
|---|---|
long |
count(Class<?> type)
Total number of elements with given type available.
|
long |
count(KeyValueQuery<?> query,
Class<?> type)
Total number of elements matching given query.
|
void |
delete(Class<?> type)
Remove all elements of type.
|
<T> T |
delete(Object id,
Class<T> type)
Delete item of type with given id.
|
<T> T |
delete(T objectToDelete) |
<T> T |
execute(KeyValueCallback<T> action)
Execute operation against underlying store.
|
<T> Iterable<T> |
find(KeyValueQuery<?> query,
Class<T> type)
Get all elements matching the given query.
|
<T> Iterable<T> |
findAll(Class<T> type)
Get all elements of given type.
|
<T> Iterable<T> |
findAll(Sort sort,
Class<T> type)
Get all elements ordered by sort.
|
<T> Optional<T> |
findById(Object id,
Class<T> type)
Get element of given type with given id.
|
<T> Iterable<T> |
findInRange(long offset,
int rows,
Class<T> type)
Get all elements in given range.
|
<T> Iterable<T> |
findInRange(long offset,
int rows,
Sort sort,
Class<T> type)
Get all elements in given range ordered by sort.
|
MappingContext<?,?> |
getMappingContext() |
void |
insert(Object id,
Object objectToInsert)
Add object with given id.
|
<T> T |
insert(T objectToInsert)
Add given object.
|
void |
update(Object objectToUpdate) |
void |
update(Object id,
Object objectToUpdate) |
destroy<T> T insert(T objectToInsert)
objectToInsert - void insert(Object id, Object objectToInsert)
id - must not be null.objectToInsert - must not be null.<T> Iterable<T> findAll(Class<T> type)
KeySpace if present and therefore returns all elements that can be
assigned to requested type.type - must not be null.<T> Iterable<T> findAll(Sort sort, Class<T> type)
KeySpace if present and therefore returns all elements that can
be assigned to requested type.sort - must not be null.type - must not be null.<T> Optional<T> findById(Object id, Class<T> type)
KeySpace if present and therefore returns all elements
that can be assigned to requested type.id - must not be null.type - must not be null.Optional.empty() if not found.@Nullable <T> T execute(KeyValueCallback<T> action)
action - must not be null.<T> Iterable<T> find(KeyValueQuery<?> query, Class<T> type)
KeySpace if present and therefore returns all elements that can be assigned to requested type..query - must not be null.type - must not be null.<T> Iterable<T> findInRange(long offset, int rows, Class<T> type)
KeySpace if present and therefore returns all elements that can
be assigned to requested type.offset - rows - type - must not be null.<T> Iterable<T> findInRange(long offset, int rows, Sort sort, Class<T> type)
KeySpace if present and therefore returns all
elements that can be assigned to requested type.offset - rows - sort - type - void update(Object objectToUpdate)
objectToUpdate - must not be null.void update(Object id, Object objectToUpdate)
id - must not be null.objectToUpdate - must not be null.void delete(Class<?> type)
KeySpace if present and therefore removes all elements that can be
assigned to requested type.type - must not be null.@Nullable <T> T delete(T objectToDelete)
objectToDelete - must not be null.@Nullable <T> T delete(Object id, Class<T> type)
id - must not be null.type - must not be null.long count(Class<?> type)
KeySpace if present and therefore counts all
elements that can be assigned to requested type.type - must not be null.long count(KeyValueQuery<?> query, Class<?> type)
KeySpace if present and therefore counts all
elements that can be assigned to requested type.query - type - MappingContext<?,?> getMappingContext()
Copyright © 2011–2019 Pivotal Software, Inc.. All rights reserved.