public class ModuleEntityStoreUnitOfWork extends Object implements EntityStoreUnitOfWork
Constructor and Description |
---|
ModuleEntityStoreUnitOfWork(ModuleSpi module,
EntityStoreUnitOfWork underlying) |
Modifier and Type | Method and Description |
---|---|
StateCommitter |
applyChanges() |
long |
currentTime() |
void |
discard() |
EntityState |
entityStateOf(ModuleSpi module,
EntityReference reference)
Get the EntityState for a given identity.
|
String |
identity() |
ModuleSpi |
module() |
EntityState |
newEntityState(ModuleSpi module,
EntityReference reference,
EntityDescriptor descriptor)
Create new EntityState for a given identity.
|
Usecase |
usecase() |
public ModuleEntityStoreUnitOfWork(ModuleSpi module, EntityStoreUnitOfWork underlying)
public ModuleSpi module()
public String identity()
identity
in interface EntityStoreUnitOfWork
public long currentTime()
currentTime
in interface EntityStoreUnitOfWork
public EntityState newEntityState(ModuleSpi module, EntityReference reference, 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
reference
- the identity of the entitydescriptor
- entity descriptorEntityStoreException
- Thrown if creational fails.public EntityState entityStateOf(ModuleSpi module, EntityReference reference) throws EntityStoreException, EntityNotFoundException
EntityStoreUnitOfWork
EntityNotFoundException
if the entity with given anIdentity
is not found.entityStateOf
in interface EntityStoreUnitOfWork
reference
- The entity identity. This argument must not be null
.EntityStoreException
- thrown if retrieval failed.EntityNotFoundException
- if requested entity does not existpublic StateCommitter applyChanges() throws EntityStoreException
applyChanges
in interface EntityStoreUnitOfWork
EntityStoreException
public void discard()
discard
in interface EntityStoreUnitOfWork
public Usecase usecase()
usecase
in interface EntityStoreUnitOfWork