org.qi4j.entitystore.neo4j
Class NeoEntityStoreUnitOfWork

java.lang.Object
  extended by org.qi4j.entitystore.neo4j.NeoEntityStoreUnitOfWork
All Implemented Interfaces:
EntityStoreUnitOfWork, StateCommitter

public class NeoEntityStoreUnitOfWork
extends Object
implements EntityStoreUnitOfWork, StateCommitter


Method Summary
 StateCommitter applyChanges()
           
 void cancel()
           
 void commit()
           
 void discard()
           
 EntityState getEntityState(EntityReference anIdentity)
          Get the EntityState for a given identity.
 String identity()
           
 EntityState newEntityState(EntityReference anIdentity, EntityDescriptor entityDescriptor)
          Create new EntityState for a given identity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

applyChanges

public StateCommitter applyChanges()
                            throws EntityStoreException
Specified by:
applyChanges in interface EntityStoreUnitOfWork
Throws:
EntityStoreException

discard

public void discard()
Specified by:
discard in interface EntityStoreUnitOfWork

getEntityState

public EntityState getEntityState(EntityReference anIdentity)
                           throws EntityStoreException,
                                  EntityNotFoundException
Description copied from interface: EntityStoreUnitOfWork
Get the EntityState for a given identity. Throws EntityNotFoundException if the entity with given anIdentity is not found.

Specified by:
getEntityState in interface EntityStoreUnitOfWork
Parameters:
anIdentity - The entity identity. This argument must not be null.
Returns:
Entity state given the composite descriptor and identity.
Throws:
EntityStoreException - thrown if retrieval failed.
EntityNotFoundException - if requested entity does not exist

newEntityState

public EntityState newEntityState(EntityReference anIdentity,
                                  EntityDescriptor entityDescriptor)
                           throws EntityStoreException
Description copied from interface: EntityStoreUnitOfWork
Create new EntityState for a given identity.

This should only create the EntityState and not insert it into any database, since that should occur during the EntityStoreUnitOfWork.applyChanges() call.

Specified by:
newEntityState in interface EntityStoreUnitOfWork
Parameters:
anIdentity - the identity of the entity
entityDescriptor - entity descriptor
Returns:
The new entity state.
Throws:
EntityStoreException - Thrown if creational fails.

cancel

public void cancel()
Specified by:
cancel in interface StateCommitter

commit

public void commit()
Specified by:
commit in interface StateCommitter

identity

public String identity()
Specified by:
identity in interface EntityStoreUnitOfWork