org.qi4j.spi.entitystore
Interface EntityStoreUnitOfWork

All Known Implementing Classes:
DefaultEntityStoreUnitOfWork, GaeEntityStoreUnitOfWork, NeoEntityStoreUnitOfWork

public interface EntityStoreUnitOfWork

JAVADOC


Method Summary
 StateCommitter applyChanges()
           
 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.
 

Method Detail

identity

String identity()

newEntityState

EntityState newEntityState(EntityReference anIdentity,
                           EntityDescriptor entityDescriptor)
                           throws EntityStoreException
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 applyChanges() call.

Parameters:
anIdentity - the identity of the entity
entityDescriptor - entity descriptor
Returns:
The new entity state.
Throws:
EntityStoreException - Thrown if creational fails.

getEntityState

EntityState getEntityState(EntityReference anIdentity)
                           throws EntityStoreException,
                                  EntityNotFoundException
Get the EntityState for a given identity. Throws EntityNotFoundException if the entity with given anIdentity is not found.

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

applyChanges

StateCommitter applyChanges()
                            throws EntityStoreException
Throws:
EntityStoreException

discard

void discard()