I- the type for IDs of this class of aggregates
S- the type of the state held by the aggregate part
B- the type of the aggregate part state builder
R- the type of the aggregate root
@Experimental public abstract class AggregatePart<I,S extends io.spine.base.EntityState,B extends io.spine.protobuf.ValidatingBuilder<S>,R extends AggregateRoot<I>> extends Aggregate<I,S,B>
Some business logic objects may be big enough. If not all parts of such a business object need to be preserved at the same time as business logic invariants, such an object can be split into several parts.
Each such part would:
To access parts of the aggregate,
AggregateRoot should be used.
If your business logic cannot be split into parts, it can be modified separately.
Aggregate instead of several
|Modifier and Type||Class and Description|
Enumeration of generic type parameters of this class.
|Modifier||Constructor and Description|
Creates a new instance of the aggregate part.
|Modifier and Type||Method and Description|
Obtains a state of another
Obtains model class for this aggregate part.
builder, clearRecentHistory, dispatchCommand, historyBackward, historyContains, missingTxMessage, play, recentHistory, versionNumber
expectedDefault, expectedEmpty, expectedNotDefault, expectedNotDefault, expectedNotEmpty, producerId, unexpectedValue, unexpectedValue
getLifecycleFlags, remember, setArchived, setDeleted, setInitialState, tx
checkEntityState, checkNotArchived, checkNotDeleted, defaultState, equals, hashCode, id, idAsString, isArchived, isDeleted, lifecycleFlagsChanged, state, toString, version, whenModified
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
protected AggregatePart(R root)
root- a root of the aggregate to which this part belongs
protected AggregatePartClass<?> thisClass()
protected <P extends io.spine.base.EntityState> P partState(java.lang.Class<P> partStateClass)
AggregatePartby its class.
P- the type of the part state
partStateClass- the class of the state of the part
java.lang.IllegalStateException- if a repository was not found, or the ID type of the part state does not match the ID type of the