@Experimental
@SPI
public interface AggregateRootDirectory
In the directory, the aggregate root is represented by its type and the parts - by their repositories.
Modifier and Type | Method and Description |
---|---|
java.util.Optional<? extends AggregatePartRepository<?,?,?>> |
findPart(java.lang.Class<? extends AggregateRoot<?>> rootClass,
java.lang.Class<? extends io.spine.base.EntityState> partStateClass)
Looks up an aggregate part repository by the type of the root and the type of the part state.
|
void |
register(AggregatePartRepository<?,?,?> repository)
Associates the given aggregate part repository and the respective root type.
|
void register(AggregatePartRepository<?,?,?> repository)
java.util.Optional<? extends AggregatePartRepository<?,?,?>> findPart(java.lang.Class<? extends AggregateRoot<?>> rootClass, java.lang.Class<? extends io.spine.base.EntityState> partStateClass)
If a matching repository if registered, it is obtained by this method with no regard to the visibility of the aggregate.
rootClass
- the type of the aggregate rootpartStateClass
- the type of the part stateAggregatePartRepository
or Optional.empty()
if such a repository
is not registered