public class InfinispanDialect<EK,AK,ISK> extends BaseGridDialect
| Constructor and Description |
|---|
InfinispanDialect(org.hibernate.ogm.datastore.infinispan.impl.InfinispanEmbeddedDatastoreProvider provider) |
| Modifier and Type | Method and Description |
|---|---|
Association |
createAssociation(AssociationKey key,
AssociationContext associationContext)
Creates a new (empty) association for storing the tuples representing the rows corresponding to the given key.
|
Tuple |
createTuple(EntityKey key,
OperationContext operationContext)
Creates a new tuple for the given entity key.
|
void |
forEachTuple(ModelConsumer consumer,
TupleTypeContext tupleTypeContext,
EntityKeyMetadata entityKeyMetadata)
A consumer is called for each tuple matching the selected
EntityKeyMetadata. |
Association |
getAssociation(AssociationKey key,
AssociationContext associationContext)
Return the list of tuples corresponding to a given association and the given context
|
LockingStrategy |
getLockingStrategy(Lockable lockable,
LockMode lockMode)
Get a strategy instance which knows how to acquire a database-level lock
of the specified/mode for this dialect.
|
Tuple |
getTuple(EntityKey key,
OperationContext operationContext)
Return the tuple with the given column for a given key
|
void |
insertOrUpdateAssociation(AssociationKey key,
Association association,
AssociationContext associationContext)
Inserts or updates the given association in the datastore.
|
void |
insertOrUpdateTuple(EntityKey key,
org.hibernate.ogm.entityentry.impl.TuplePointer tuplePointer,
TupleContext tupleContext)
Inserts or updates the tuple corresponding to the given entity key.
|
boolean |
isStoredInEntityStructure(AssociationKeyMetadata associationKeyMetadata,
AssociationTypeContext associationTypeContext)
Whether the specified association is stored within an entity structure or not.
|
Number |
nextValue(NextValueRequest request)
Returns the next value from the specified id generator with the specified increment.
|
void |
removeAssociation(AssociationKey key,
AssociationContext associationContext)
Remove the list of tuples corresponding to a given association
|
void |
removeTuple(EntityKey key,
TupleContext tupleContext)
Remove the tuple for a given key
|
boolean |
supportsSequences()
With the introduction of Infinispan clustered counter
SequenceGenerator strategy is now supported
|
getDuplicateInsertPreventionStrategy, isInTheInsertionQueue, overrideType, usesNavigationalInformationForInverseSideOfAssociationspublic InfinispanDialect(org.hibernate.ogm.datastore.infinispan.impl.InfinispanEmbeddedDatastoreProvider provider)
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode)
getLockingStrategy in interface GridDialectgetLockingStrategy in class BaseGridDialectlockable - The persister for the entity to be locked.lockMode - The type of lock to be acquired.public Tuple getTuple(EntityKey key, OperationContext operationContext)
GridDialectkey - The tuple identifieroperationContext - Contains additional information that might be used to create the tuplepublic Tuple createTuple(EntityKey key, OperationContext operationContext)
GridDialect
Only invoked if no tuple is present yet for the given key. Implementations should not perform a round-trip to the
datastore but rather return a transient instance. The OGM engine will invoke
GridDialect.insertOrUpdateTuple(EntityKey, TuplePointer, TupleContext) subsequently.
Columns in the tuple may represent properties of the corresponding entity as well as *-to-one associations to other entities. Implementations may choose to persist the latter e.g. in form of fields or as actual links/relationships to the element representing the associated entity. In case of multi-column keys, the corresponding association role for a given column can be obtained from the passed tuple context.
key - The tuple identifieroperationContext - Contains additional information that might be used to create the tuplepublic void insertOrUpdateTuple(EntityKey key, org.hibernate.ogm.entityentry.impl.TuplePointer tuplePointer, TupleContext tupleContext)
GridDialectkey - The tuple identifiertuplePointer - A pointer to the list of operations to executetupleContext - Contains additional information that might be used to create or update the tuplepublic void removeTuple(EntityKey key, TupleContext tupleContext)
GridDialectkey - The tuple identifiertupleContext - Contains additional information that might be used to remove the tuplepublic Association getAssociation(AssociationKey key, AssociationContext associationContext)
GridDialectkey - Identifies the associationassociationContext - Contains additional information that might be used to get the associationpublic Association createAssociation(AssociationKey key, AssociationContext associationContext)
GridDialect
Only invoked if the association does not yet exist in the datastore. Implementations should not perform a
round-trip to the datastore but rather return a transient instance. The OGM engine will invoke
GridDialect.insertOrUpdateAssociation(AssociationKey, Association, AssociationContext) subsequently.
key - Identifies the associationassociationContext - Contains additional information that might be used to create the associationpublic void insertOrUpdateAssociation(AssociationKey key, Association association, AssociationContext associationContext)
GridDialectkey - Identifies the associationassociation - The list of operations to executeassociationContext - Contains additional information that might be used to create the associationpublic void removeAssociation(AssociationKey key, AssociationContext associationContext)
GridDialectkey - Identifies the associationassociationContext - Contains additional information that might be used to remove an associationpublic boolean isStoredInEntityStructure(AssociationKeyMetadata associationKeyMetadata, AssociationTypeContext associationTypeContext)
GridDialecttrue if this is the
case for a given association.associationKeyMetadata - identifies the association of interestassociationTypeContext - provides additional contextual information about the represented association type,
such as the options effectively applying for ittrue if the specified association is stored within an entity structure, false otherwise.public Number nextValue(NextValueRequest request)
GridDialectrequest - Identifies a specific id generatorpublic void forEachTuple(ModelConsumer consumer, TupleTypeContext tupleTypeContext, EntityKeyMetadata entityKeyMetadata)
GridDialectEntityKeyMetadata. The tuples must be of the
same indexed type.consumer - the instance that is going to be called for every TupletupleTypeContext - contains additional information that might be used to build the tupleentityKeyMetadata - the key metadata of the table for which we want to apply the consumerpublic boolean supportsSequences()
supportsSequences in interface GridDialectsupportsSequences in class BaseGridDialectCopyright © 2010-2018 Red Hat, Inc. and others. Licensed under the GNU Lesser General Public License (LGPL), version 2.1 or later.