クラス RedisKeyValueTemplate

java.lang.ObjectSE
org.springframework.data.keyvalue.core.KeyValueTemplate
org.springframework.data.redis.core.RedisKeyValueTemplate
実装されたすべてのインターフェース:
AwareDisposableBeanApplicationEventPublisherAwareKeyValueOperations

public class RedisKeyValueTemplate extends KeyValueTemplate
KeyValueTemplate の Redis 固有の実装。
導入:
1.7
作成者:
Christoph Strobl, Mark Paluch
  • コンストラクターの詳細

  • メソッドの詳細

    • getConverter

      public RedisConverter getConverter()
      基になる redis 固有の EntityConverter を取得します。
      戻り値:
      決して null にはなりません。
      導入:
      2.1
    • getMappingContext

      public RedisMappingContext getMappingContext()
      次で指定:
      インターフェース KeyValueOperationsgetMappingContext 
      オーバーライド:
      クラス KeyValueTemplategetMappingContext 
    • find

      public <T> ListSE<T> find(RedisCallback<?> callback, ClassSE<T> type)
      ID を解決し、必要な型に変換して、エンティティを取得します。
      コールバックは、単一の ID または ID の IterableSE のいずれかを提供します。これは、実際のドメイン型を取得するために使用され、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

      public <T> T insert(ObjectSE id, T objectToInsert)
      次で指定:
      インターフェース KeyValueOperationsinsert 
      オーバーライド:
      クラス KeyValueTemplateinsert 
    • update

      public <T> T update(T objectToUpdate)
      次で指定:
      インターフェース KeyValueOperationsupdate 
      オーバーライド:
      クラス KeyValueTemplateupdate 
    • update

      public <T> T update(ObjectSE id, T objectToUpdate)
      次で指定:
      インターフェース KeyValueOperationsupdate 
      オーバーライド:
      クラス KeyValueTemplateupdate 
    • doPartialUpdate

      protected void doPartialUpdate(PartialUpdate<?> update)