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 EntityStoreUnitOfWork
public long currentTime()
currentTime
in interface EntityStoreUnitOfWork
public Usecase usecase()
usecase
in interface EntityStoreUnitOfWork
public 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 EntityStoreUnitOfWork
anIdentity
- the identity of the entitydescriptor
- entity descriptorEntityStoreException
- Thrown if creational fails.public EntityState entityStateOf(ModuleSpi module, EntityReference anIdentity) throws EntityNotFoundException
EntityStoreUnitOfWork
EntityNotFoundException
if the entity with given anIdentity
is not found.entityStateOf
in interface EntityStoreUnitOfWork
anIdentity
- The entity identity. This argument must not be null
.EntityNotFoundException
- if requested entity does not existpublic StateCommitter applyChanges() throws EntityStoreException
applyChanges
in interface EntityStoreUnitOfWork
EntityStoreException
public void discard()
discard
in interface EntityStoreUnitOfWork