Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Hibernate OGM, Domain model persistence for NoSQL datastores
  *
  * License: GNU Lesser General Public License (LGPL), version 2.1 or later
  * See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
  */
 package org.hibernate.ogm.dialect.optimisticlock.spi;
 
A org.hibernate.ogm.dialect.spi.GridDialect facet to be implemented by those stores which support finding and altering versioned records in an atomic fashion.

Author(s):
Gunnar Morling
public interface OptimisticLockingAwareGridDialect extends GridDialect {

Updates the given tuple. Implementors are expected to perform the update only if the entity has the given old version in the datastore. Specifically, atomic "find and update" semantics should be applied.

Parameters:
entityKey The key of the entity to save
oldLockState A tuple with all those column values identifying the previous version of the record in the datastore. Implementations are expected to apply all the contained columns to select the record to be updated.
tuple The entity column values to save
tupleContext Provides additional meta-data useful for the tuple update
Returns:
true if the update succeeded, false otherwise (e.g. if the entity has been updated in the datastore in parallel, so it has a newer version then the given one).
	boolean updateTupleWithOptimisticLock(EntityKey entityKeyTuple oldLockStateTuple tupleTupleContext tupleContext);

Removes the given tuple. Implementors are expected to perform the delete only if the entity has the given old version in the datastore. Specifically, atomic "find and delete" semantics should be applied.

Parameters:
entityKey The key of the entity to save
oldLockState A tuple with all those column values identifying the previous version of the record in the datastore. Implementations are expected to apply all the contained columns to select the record to be removed.
tupleContext Provides additional meta-data useful for the tuple removal
Returns:
true if the deletion succeeded, false otherwise (e.g. if the entity has been removed or updated in the datastore in parallel, so it has a newer version then the given one).
	boolean removeTupleWithOptimisticLock(EntityKey entityKeyTuple oldLockStateTupleContext tupleContext);
New to GrepCode? Check out our FAQ X