public final class DefaultEntityStoreUnitOfWork extends Object implements EntityStoreUnitOfWork
| Constructor and Description |
|---|
DefaultEntityStoreUnitOfWork(EntityStoreSPI entityStoreSPI,
String identity,
Usecase usecase,
long currentTime) |
| Modifier and Type | Method and Description |
|---|---|
StateCommitter |
applyChanges() |
long |
currentTime() |
void |
discard() |
EntityState |
entityStateOf(ModuleSpi module,
EntityReference anIdentity)
Get the EntityState for a given identity.
|
String |
identity() |
EntityState |
newEntityState(ModuleSpi module,
EntityReference anIdentity,
EntityDescriptor descriptor)
Create new EntityState for a given identity.
|
Usecase |
usecase() |
public DefaultEntityStoreUnitOfWork(EntityStoreSPI entityStoreSPI, String identity, Usecase usecase, long currentTime)
public String identity()
identity in interface EntityStoreUnitOfWorkpublic long currentTime()
currentTime in interface EntityStoreUnitOfWorkpublic Usecase usecase()
usecase in interface EntityStoreUnitOfWorkpublic EntityState newEntityState(ModuleSpi module, EntityReference anIdentity, EntityDescriptor descriptor) throws EntityStoreException
EntityStoreUnitOfWork
This should only create the EntityState and not insert it into any database, since that should occur during
the EntityStoreUnitOfWork.applyChanges() call.
newEntityState in interface EntityStoreUnitOfWorkanIdentity - the identity of the entitydescriptor - entity descriptorEntityStoreException - Thrown if creational fails.public EntityState entityStateOf(ModuleSpi module, EntityReference anIdentity) throws EntityNotFoundException
EntityStoreUnitOfWorkEntityNotFoundException
if the entity with given anIdentity is not found.entityStateOf in interface EntityStoreUnitOfWorkanIdentity - The entity identity. This argument must not be null.EntityNotFoundException - if requested entity does not existpublic StateCommitter applyChanges() throws EntityStoreException
applyChanges in interface EntityStoreUnitOfWorkEntityStoreExceptionpublic void discard()
discard in interface EntityStoreUnitOfWork