public class RedisKeyValueTemplate
extends org.springframework.data.keyvalue.core.KeyValueTemplate
KeyValueTemplate.| Modifier and Type | Class and Description |
|---|---|
static class |
RedisKeyValueTemplate.RedisKeyValueCallback<T>
Redis specific
KeyValueCallback. |
| Constructor and Description |
|---|
RedisKeyValueTemplate(RedisKeyValueAdapter adapter,
RedisMappingContext mappingContext)
Create new
RedisKeyValueTemplate. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doPartialUpdate(PartialUpdate<?> update) |
<T> List<T> |
find(RedisCallback<?> callback,
Class<T> type)
Retrieve entities by resolving their ids and converting them into required type.
|
RedisConverter |
getConverter()
Obtain the underlying redis specific
EntityConverter. |
RedisMappingContext |
getMappingContext() |
<T> T |
insert(Object id,
T objectToInsert) |
<T> T |
update(Object id,
T objectToUpdate) |
<T> T |
update(T objectToUpdate) |
count, count, delete, delete, delete, destroy, execute, executeRequired, exists, find, findAll, findAll, findById, findInRange, findInRange, insert, setApplicationEventPublisher, setEventTypesToPublish, setExceptionTranslatorpublic RedisKeyValueTemplate(RedisKeyValueAdapter adapter, RedisMappingContext mappingContext)
RedisKeyValueTemplate.adapter - must not be null.mappingContext - must not be null.public RedisConverter getConverter()
EntityConverter.public RedisMappingContext getMappingContext()
getMappingContext in interface org.springframework.data.keyvalue.core.KeyValueOperationsgetMappingContext in class org.springframework.data.keyvalue.core.KeyValueTemplatepublic <T> List<T> find(RedisCallback<?> callback, Class<T> type)
Iterable of ids, used for retrieving
the actual domain types and shortcuts manual retrieval and conversion of ids via RedisTemplate.
List<RedisSession> sessions = template.find(new RedisCallback<Set<byte[]>>() {
public Set<byte[]< doInRedis(RedisConnection connection) throws DataAccessException {
return connection
.sMembers("spring:session:sessions:securityContext.authentication.principal.username:user"
.getBytes());
}
}, RedisSession.class);
callback - provides the to retrieve entity ids. Must not be null.type - must not be null.public <T> T insert(Object id, T objectToInsert)
insert in interface org.springframework.data.keyvalue.core.KeyValueOperationsinsert in class org.springframework.data.keyvalue.core.KeyValueTemplatepublic <T> T update(T objectToUpdate)
update in interface org.springframework.data.keyvalue.core.KeyValueOperationsupdate in class org.springframework.data.keyvalue.core.KeyValueTemplatepublic <T> T update(Object id, T objectToUpdate)
update in interface org.springframework.data.keyvalue.core.KeyValueOperationsupdate in class org.springframework.data.keyvalue.core.KeyValueTemplateprotected void doPartialUpdate(PartialUpdate<?> update)
Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.