public abstract class AbstractRedisDialect extends BaseGridDialect
| Modifier and Type | Field and Description |
|---|---|
static String |
ASSOCIATIONS |
protected boolean |
clusterMode |
protected com.lambdaworks.redis.cluster.api.sync.RedisClusterCommands<String,String> |
connection |
static String |
IDENTIFIERS |
protected JsonSerializationStrategy |
strategy |
| Constructor and Description |
|---|
AbstractRedisDialect(com.lambdaworks.redis.cluster.api.sync.RedisClusterCommands<String,String> connection,
boolean configuredForCluster)
Creates a new
AbstractRedisDialect. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addIdToEntity(Entity entity,
String[] columnNames,
Object[] columnValues) |
protected void |
addKeyValuesFromKeyName(EntityKeyMetadata entityKeyMetadata,
String prefix,
String key,
Entity document) |
protected String |
associationId(AssociationKey key)
Create a String representation of the entity key in the format of
Association:(table name):(columnId). |
Tuple |
createTuple(EntityKey key,
TupleContext tupleContext) |
String |
entityId(EntityKey key)
Create a String representation of the key in the format of
(table name):(columnId). |
protected void |
expireAssociation(AssociationKey key,
Long ttl) |
protected void |
expireEntity(EntityKey key,
Long ttl) |
protected Association |
getAssociation(AssociationKey key)
Retrieve association from a Redis List or Redis Set, depending on the association type.
|
protected static Object |
getAssociationRow(Tuple row,
AssociationKey associationKey) |
protected String |
getKeyWithoutTablePrefix(String prefixBytes,
String key) |
protected Long |
getTTL(AssociationContext associationContext) |
protected Long |
getTTL(OptionsContext optionsContext) |
protected String |
identifierId(IdSourceKey key)
Create a String representation of the identifier key in the format of
Identifiers:(table name):(columnId). |
boolean |
isClusterMode() |
protected Map<String,Object> |
keyStringToMap(EntityKeyMetadata entityKeyMetadata,
String key)
Deconstruct the key name into its components:
Single key: Use the value from the key
Multiple keys: De-serialize the JSON map.
|
protected Map<String,Object> |
keyToMap(EntityKeyMetadata entityKeyMetadata,
String key)
Deconstruct the key name into its components:
Single key: Use the value from the key
Multiple keys: De-serialize the JSON map.
|
Number |
nextValue(NextValueRequest request) |
protected void |
remove(EntityKey key) |
protected void |
removeAssociation(AssociationKey key) |
void |
removeTuple(EntityKey key,
TupleContext tupleContext) |
protected com.lambdaworks.redis.KeyScanCursor<String> |
scan(com.lambdaworks.redis.KeyScanCursor<String> cursor,
com.lambdaworks.redis.ScanArgs scanArgs)
Scan over keys.
|
protected void |
setAssociationTTL(AssociationKey associationKey,
AssociationContext associationContext,
Long currentTtl) |
protected void |
setEntityTTL(EntityKey key,
Long currentTtl,
Long configuredTTL) |
protected void |
storeAssociation(AssociationKey key,
Association association)
Store an association to a Redis List or Redis Set, depending on the association type.
|
boolean |
supportsSequences() |
getDuplicateInsertPreventionStrategy, getLockingStrategy, overrideTypeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateAssociation, forEachTuple, getAssociation, getTuple, insertOrUpdateAssociation, insertOrUpdateTuple, isStoredInEntityStructure, removeAssociationpublic static final String IDENTIFIERS
public static final String ASSOCIATIONS
protected final com.lambdaworks.redis.cluster.api.sync.RedisClusterCommands<String,String> connection
protected final JsonSerializationStrategy strategy
protected final boolean clusterMode
public AbstractRedisDialect(com.lambdaworks.redis.cluster.api.sync.RedisClusterCommands<String,String> connection, boolean configuredForCluster)
AbstractRedisDialect.connection - a Redis connection (A regular Redis connection implements also RedisClusterCommands)configuredForCluster - true if the connection is configured for cluster operations.public Tuple createTuple(EntityKey key, TupleContext tupleContext)
public Number nextValue(NextValueRequest request)
public boolean supportsSequences()
supportsSequences in interface GridDialectsupportsSequences in class BaseGridDialectprotected String identifierId(IdSourceKey key)
Identifiers:(table name):(columnId).
IDENTIFIERSkey - Key for the identifierpublic void removeTuple(EntityKey key, TupleContext tupleContext)
protected void addKeyValuesFromKeyName(EntityKeyMetadata entityKeyMetadata, String prefix, String key, Entity document)
protected static Object getAssociationRow(Tuple row, AssociationKey associationKey)
protected Long getTTL(OptionsContext optionsContext)
protected Long getTTL(AssociationContext associationContext)
protected void setAssociationTTL(AssociationKey associationKey, AssociationContext associationContext, Long currentTtl)
protected void expireAssociation(AssociationKey key, Long ttl)
protected void removeAssociation(AssociationKey key)
protected void remove(EntityKey key)
protected Map<String,Object> keyStringToMap(EntityKeyMetadata entityKeyMetadata, String key)
protected void addIdToEntity(Entity entity, String[] columnNames, Object[] columnValues)
protected String associationId(AssociationKey key)
Association:(table name):(columnId).
ASSOCIATIONSkey - Key of the associationpublic String entityId(EntityKey key)
(table name):(columnId).key - Key of the entityprotected Map<String,Object> keyToMap(EntityKeyMetadata entityKeyMetadata, String key)
protected Association getAssociation(AssociationKey key)
key - the association keyprotected void storeAssociation(AssociationKey key, Association association)
key - the association keyassociation - the association documentprotected com.lambdaworks.redis.KeyScanCursor<String> scan(com.lambdaworks.redis.KeyScanCursor<String> cursor, com.lambdaworks.redis.ScanArgs scanArgs)
KeyScanCursor instance.cursor - scanArgs - public boolean isClusterMode()
true if the connected Redis node (default connection) is running in Redis Cluster mode.Copyright © 2010–2016 Hibernate. All rights reserved.