T - The type of aggregate this repository stores.public interface Repository<T> extends ScopeAware
| Modifier and Type | Method and Description |
|---|---|
Aggregate<T> |
load(String aggregateIdentifier)
Load the aggregate with the given unique identifier.
|
Aggregate<T> |
load(String aggregateIdentifier,
Long expectedVersion)
Load the aggregate with the given unique identifier.
|
Aggregate<T> |
newInstance(Callable<T> factoryMethod)
Creates a new managed instance for the aggregate, using the given
factoryMethod
to instantiate the aggregate's root. |
canResolve, sendAggregate<T> load(String aggregateIdentifier)
aggregateIdentifier - The identifier of the aggregate to loadAggregateNotFoundException - if aggregate with given id cannot be foundAggregate<T> load(String aggregateIdentifier, Long expectedVersion)
aggregateIdentifier - The identifier of the aggregate to loadexpectedVersion - The expected version of the loaded aggregateAggregateNotFoundException - if aggregate with given id cannot be foundAggregate<T> newInstance(Callable<T> factoryMethod) throws Exception
factoryMethod
to instantiate the aggregate's root.factoryMethod - The method to create the aggregate's root instanceException - when the factoryMethod throws an exceptionCopyright © 2010–2018. All rights reserved.