public interface UnitOfWorkFactory
Modifier and Type | Method and Description |
---|---|
UnitOfWork |
currentUnitOfWork()
Returns the UnitOfWork that is currently associated with the executing thread.
|
UnitOfWork |
getUnitOfWork(EntityComposite entity)
Returns the UnitOfWork that the EntityComposite is bound to.
|
boolean |
isUnitOfWorkActive() |
UnitOfWork |
newUnitOfWork()
Create a new UnitOfWork and associate it with the current thread.
|
UnitOfWork |
newUnitOfWork(Instant currentTime)
Create a new UnitOfWork and associate it with the current thread.
|
UnitOfWork |
newUnitOfWork(Usecase usecase)
Create a new UnitOfWork for the given Usecase and associate it with the current thread.
|
UnitOfWork |
newUnitOfWork(Usecase usecase,
Instant currentTime)
Create a new UnitOfWork for the given Usecase and associate it with the current thread.
|
UnitOfWork newUnitOfWork()
The UnitOfWork will use the default Usecase settings.
Current time will be set to SystemTime.now()
UnitOfWork newUnitOfWork(Instant currentTime)
The UnitOfWork will use the default Usecase settings.
currentTime
- the current time for this UnitOfWorkUnitOfWork newUnitOfWork(Usecase usecase)
Current time will be set to SystemTime.now()
usecase
- the Usecase for this UnitOfWorkUnitOfWork newUnitOfWork(Usecase usecase, Instant currentTime)
usecase
- the Usecase for this UnitOfWorkcurrentTime
- the current time for this UnitOfWorkboolean isUnitOfWorkActive()
UnitOfWork currentUnitOfWork() throws IllegalStateException
IllegalStateException
- if no current UnitOfWork is activeUnitOfWork getUnitOfWork(EntityComposite entity)
entity
- the entity to be checked.