public final class DefaultEntityStoreUnitOfWork extends Object implements EntityStoreUnitOfWork
| Constructor and Description |
|---|
DefaultEntityStoreUnitOfWork(ModuleDescriptor module,
EntityStoreSPI entityStoreSPI,
Identity identity,
Usecase usecase,
Instant currentTime) |
| Modifier and Type | Method and Description |
|---|---|
StateCommitter |
applyChanges() |
Instant |
currentTime() |
void |
discard() |
EntityState |
entityStateOf(ModuleDescriptor module,
EntityReference anIdentity)
Get the EntityState for a given reference.
|
Identity |
identity() |
ModuleDescriptor |
module() |
EntityState |
newEntityState(EntityReference anIdentity,
EntityDescriptor descriptor)
Create new EntityState for a given reference.
|
Usecase |
usecase() |
String |
versionOf(EntityReference anIdentity) |
public DefaultEntityStoreUnitOfWork(ModuleDescriptor module, EntityStoreSPI entityStoreSPI, Identity identity, Usecase usecase, Instant currentTime)
public Identity identity()
identity in interface EntityStoreUnitOfWorkpublic Instant currentTime()
currentTime in interface EntityStoreUnitOfWorkpublic Usecase usecase()
usecase in interface EntityStoreUnitOfWorkpublic ModuleDescriptor module()
module in interface EntityStoreUnitOfWorkpublic EntityState newEntityState(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 reference of the entitydescriptor - entity descriptorEntityStoreException - Thrown if creational fails.public EntityState entityStateOf(ModuleDescriptor module, EntityReference anIdentity) throws EntityNotFoundException
EntityStoreUnitOfWorkEntityNotFoundException
if the entity with given anIdentity is not found.entityStateOf in interface EntityStoreUnitOfWorkmodule - Module descriptoranIdentity - The entity reference. This argument must not be null.EntityNotFoundException - if requested entity does not existpublic String versionOf(EntityReference anIdentity) throws EntityNotFoundException
versionOf in interface EntityStoreUnitOfWorkEntityNotFoundExceptionpublic StateCommitter applyChanges() throws EntityStoreException
applyChanges in interface EntityStoreUnitOfWorkEntityStoreExceptionpublic void discard()
discard in interface EntityStoreUnitOfWork