クラス RedisKeyValueTemplate
java.lang.ObjectSE
org.springframework.data.keyvalue.core.KeyValueTemplate
org.springframework.data.redis.core.RedisKeyValueTemplate
- 実装されたすべてのインターフェース:
Aware
、DisposableBean
、ApplicationEventPublisherAware
、KeyValueOperations
KeyValueTemplate
の Redis 固有の実装。- 導入:
- 1.7
- 作成者:
- Christoph Strobl, Mark Paluch
ネストされたクラスのサマリー
ネストされたクラスコンストラクターのサマリー
コンストラクターコンストラクター説明RedisKeyValueTemplate
(RedisKeyValueAdapter adapter, RedisMappingContext mappingContext) 新しいRedisKeyValueTemplate
を作成します。メソッドのサマリー
修飾子と型メソッド説明protected void
doPartialUpdate
(PartialUpdate<?> update) <T> ListSE<T>
find
(RedisCallback<?> callback, ClassSE<T> type) ID を解決し、必要な型に変換してエンティティを取得します。基になる redis 固有のEntityConverter
を取得します。<T> T
<T> T
<T> T
update
(T objectToUpdate) クラス org.springframework.data.keyvalue.core.KeyValueTemplate から継承されたメソッド
count, count, delete, delete, delete, destroy, execute, executeRequired, exists, find, findAll, findAll, findById, findInRange, findInRange, getKeyValueAdapter, insert, setApplicationEventPublisher, setEventTypesToPublish, setExceptionTranslator
コンストラクターの詳細
RedisKeyValueTemplate
新しいRedisKeyValueTemplate
を作成します。- パラメーター:
adapter
- null であってはなりません。mappingContext
- null であってはなりません。
メソッドの詳細
getConverter
基になる redis 固有のEntityConverter
を取得します。- 戻り値:
- 決して null にはなりません。
- 導入:
- 2.1
getMappingContext
- 次で指定:
- インターフェース
KeyValueOperations
のgetMappingContext
- オーバーライド:
- クラス
KeyValueTemplate
のgetMappingContext
find
ID を解決し、必要な型に変換して、エンティティを取得します。
コールバックは、単一の ID または ID のIterable
SE のいずれかを提供します。これは、実際のドメイン型を取得するために使用され、RedisTemplate
を介して ID の手動検索と変換をショートカットします。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
- エンティティ ID を取得するためのを提供します。null であってはなりません。type
- null であってはなりません。- 戻り値:
- 要素が見つからない場合は空のリスト。
insert
- 次で指定:
- インターフェース
KeyValueOperations
のinsert
- オーバーライド:
- クラス
KeyValueTemplate
のinsert
update
public <T> T update(T objectToUpdate) - 次で指定:
- インターフェース
KeyValueOperations
のupdate
- オーバーライド:
- クラス
KeyValueTemplate
のupdate
update
- 次で指定:
- インターフェース
KeyValueOperations
のupdate
- オーバーライド:
- クラス
KeyValueTemplate
のupdate
doPartialUpdate