public abstract class AbstractRedisDialect extends AbstractGroupingByEntityDialect
| 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). |
String |
entityId(EntityKey key)
Create a String representation of the key in the format of
(table name):(columnId). |
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 TuplePointer |
getEmbeddingEntityTuplePointer(AssociationKey key,
AssociationContext associationContext)
Retrieve entity that contains the association, do not enhance with entity key
|
protected String |
getKeyWithoutTablePrefix(String prefixBytes,
String key) |
protected Long |
getObjectTTL(String objectId,
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,String> |
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 |
removeAssociations(List<AssociationKey> keys) |
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 |
setObjectTTL(String objectId,
Long ttl) |
protected void |
storeAssociation(AssociationKey key,
Association association)
Store an association to a Redis List or Redis Set, depending on the association type.
|
boolean |
supportsSequences() |
executeBatch, executeGroupedChangesToEntity, flushPendingOperations, insertOrUpdateAssociation, insertOrUpdateTuple, removeAssociationgetDuplicateInsertPreventionStrategy, getLockingStrategy, isInTheInsertionQueue, overrideType, usesNavigationalInformationForInverseSideOfAssociationsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateAssociation, createTuple, forEachTuple, getAssociation, getDuplicateInsertPreventionStrategy, getLockingStrategy, getTuple, isStoredInEntityStructure, overrideType, usesNavigationalInformationForInverseSideOfAssociationspublic 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 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 getObjectTTL(String objectId, OptionsContext optionsContext)
protected void removeAssociations(List<AssociationKey> keys)
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,String> 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 TuplePointer getEmbeddingEntityTuplePointer(AssociationKey key, AssociationContext associationContext)
protected 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.